CSS Concepts Flashcards
What does “content” mean in &::before { content: ‘ ‘ } declaration
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.
What css property should you use to move elements to the right, or left
float e.g. .menu-btm {
float: right;
}
How would you write a media query adjust the DOM if the window is less than a certain size?
@media (min-width:600px) {
}
What css property should you use to set font?
font-family: ‘Montserrat’;
How do you keep elements from aligning to the edge of a window if you use float: left;?
.btn {
float: left;
padding: 2em;
}
What is the minimum list of elements for a simple overlay window that obscures the rest of the DOM beneath it?
.overlay { position: absolute; background: black; padding: 2em; width: calc(100%-4em); height: calc(100%-4em); }
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% }
.overlay { ... padding: 2em; width: calc(100%-4em); height: calc(100%-4em); }
Deduct the padding from the element using the calc method.
How do you access a nav element in javascript? What HTML attribute is used?