HTML Flashcards
What does CSS stand for?
Cascading Style Sheets
What is the order of precedence for CSS (first to last)?
1-Inline
2-Document Level
3-External
Write on a piece of paper
How do we declare an external style sheet?
<link></link>
How to group selectors?
With commas
h1, h2, h3 {…}
How to access all similar elements in same class?
h1.className{…}
How to access elements within an id?
id element
What is the syntax for a descendant selector?
div p{…}
What is the syntax for a child selector?
div>p{…}
What is the difference between a descendant selector and a child selector?
While a child selector only stops at the first degree of nesting, the descendant selector selects all corresponding elements, no matter how deep they are nested.
What is the syntax for an adjacent sibling selector? What does it do?
div + p {…}
Selects the p that comes right after the div
What is the syntax for general sibling selector? What does it do?
div ~ p {…}
Selects all p that come after div, only if they have the same parent
What is the order of precedence for selectors (first to last)?
What about s case where the rules have the same weight? Which precedes?
id > class/pseudo class>simple selector>universal>default
If both selectors have the same weight, last one specified wins
In writing
List the link pseudo classes
a:link
a:hover
a:active
a:visited
What is the property to change the text size?
font-size
What is the property to change the boldness of the text?
font-weight