Basics Flashcards
vs Submit
Submit
It is considered best practice to set a for attribute on the label element, with a value…?
…that matches the value of the id attribute of the input element. This allows assistive technologies to create a linked relationship between the label and the child input element
if there are conflicting declarations within class and id in css which one would be applied?
However, an id is not reusable and should only be applied to one element. An id also has a higher specificity (importance) than a class so if both are applied to the same element and have conflicting styles, the styles of the id will be applied.
when you set padding padding: 10px 20px 10px 20px; (or whatever has 4 parameters) in what order does it work?
clockwise notation. These four values work like a clock: top, right, bottom, left, and will produce the exact same result as using the side-specific padding instructions.
how to apply CSS code to all elements with specific value of a given attribute?
[type=’radio’] {
margin: 20px 0px 20px 0px;
}
don’t forget the quotes!
Relative units, such as em or rem, are relative to another length value. Which one?
For example, em is based on the size of an element’s font. If you use it to set the font-size property itself, it’s relative to the parent’s font-size.
Overriding CSS. how many levels is there and what are they?
- html tag style
- class style
- last declared class style
- ID style
- inline style in the dag itself
- mark !important in any css block
Variables
background: var(–penguin-beak, orange);
reference to the variable and a fallback value of orange
How to set a CSS var so it is available throughout the entire document?
When you create a variable, it becomes available for you to use inside the element in which you create it. It also becomes available within any elements nested within it. This effect is known as cascading. Because of cascading, CSS variables are often defined in the :root element.
Can the css var be redefined? How to redefine it for a smaller screen size?
@media (max-width: 350px) {
:root {
/* add code below */ --penguin-size:200px; --penguin-skin:black; /* add code above */ } }
recommended alternative for <i>?</i>
<em></em>
recommended alternative for <b>?</b>
<strong></strong>
recommended alternative for ?
<del></del>
keyword for shadows?
The box-shadow property takes values for offset-x (how far to push the shadow horizontally from the element), offset-y (how far to push the shadow vertically from the element), blur-radius, spread-radius and a color value, in that order. The blur-radius and spread-radius values are optional.
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
what pseudo-classes do you know?
hover