CSS Concepts Flashcards

1
Q

What does “content” mean in &::before { content: ‘ ‘ } declaration

A

Content refers to the content created dynamically on the element that wraps the &::before and &::after selector. In this case, an empty content element is dynamically created in the browser. This is useful for borders in front of DOM elements.

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

What css property should you use to move elements to the right, or left

A

float e.g. .menu-btm {
float: right;
}

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

How would you write a media query adjust the DOM if the window is less than a certain size?

A

@media (min-width:600px) {

}

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

What css property should you use to set font?

A

font-family: ‘Montserrat’;

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

How do you keep elements from aligning to the edge of a window if you use float: left;?

A

.btn {
float: left;
padding: 2em;
}

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

What is the minimum list of elements for a simple overlay window that obscures the rest of the DOM beneath it?

A
.overlay {
  position: absolute;
  background: black;
  padding: 2em;
  width: calc(100%-4em);
  height: calc(100%-4em);
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
The following will have a scrollbar, what should the width be to avoid a situation where the scrollbar is 104%?
.overlay {
  position: absolute;
  background: black;
  padding: 2em;
  width: 100%
  height: 100%
}
A
.overlay {
  ...
  padding: 2em;
  width: calc(100%-4em);
  height: calc(100%-4em);
}

Deduct the padding from the element using the calc method.

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

How do you access a nav element in javascript? What HTML attribute is used?

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