CSS Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

display: block

A

always starts on a new line and takes up the full width available

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

display: inline

A

does not start on a new line and only takes up as much width as necessary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

display: none

A

element will be hidden, and the page will be displayed as if the element is not there

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

visibility: hidden

A

element will be hidden but will still take up the same space as before

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

position: static

A

default css positioning. Positioned according to the normal flow of the page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

position: relative

A

positioning that is related to its normal position. Setting the top, right, bottom, and left properties of a this element will cause it to be adjusted away from its normal position. Other content will not be adjusted to fit into any gap left by the element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

position: fixed

A

positioned relative to the viewport, which means it always stays in the same place even if the page is scrolled. The top, right, bottom, and left properties are used to position the element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

position: absolute;

A

position fixed inside of container element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

position: sticky

A

position is relative till user scrolls to a certain position, then becomes fixed to a certain spot

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

center a div using flexbox

A

.parent {
display: flex;
justify-content: center;
align-items: center;
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is CSS outline

A

An outline is a line drawn outside the element’s border.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what to do when the browser window is smaller than the width of the element so the browser adds a horizontal scrollbar to the page.

A

use max width property

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a pseudo-class?

A

A pseudo-class is a selector that selects elements that are in a specific state, e.g. they are the first element of their type, or they are being hovered over by the mouse pointer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Height: auto

A

Take up the height of children

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

position: relative

A

Elements with position: relative are positioned relative to their normal position. This means that you can use the top, bottom, left, or right properties to move the element from its original position. However, the element still takes up its original space in the document flow, even if it is moved.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

@include vs @extend

A

include is used for mixins, while extend is used for selectors like classes

17
Q

Pseudo class vs pseudo element

A

pseudo-classes are used to target elements based on states or interactions, while pseudo-elements are used to target specific parts of an element’s content and insert additional styling or content.

18
Q

Horizontally centre a div

A

.center-horizontally {
display: flex;
justify-content: center;
}

19
Q

Vertically centre a div

A

.center-horizontally {
display: flex;
Align-items: center;
}