Divs And Spans Flashcards
What is a common way to group related elements for styling?
“div” tags by putting div tags around the elements
What is a <div> used for?
Elements grouped together particularly for styling
How do you give a unique label to the elements in a div tag?
Usually with an id attribute
div id = “cats”
The height of an element is left at the default, which is…
Auto
___ allows the content to fill the available space, after taking into account __________, __________ and ___________.
Auto
Padding
Border
Margin
Which property aligns all the inline content (text, images, etc) in a block element?
text-align
How do you tell CSS to only select elements that descend from certain elements?
descendant selector
For the following rule, which is the parent element and which is the descendant selector?
div h2 {
Color : black ; }
div is parent
h2 is descendant
If the padding is 0px 20px 30px 10px
which is top, bottom, right, left?
0 is top
20 is right
30 is bottom
10 is left
Can use use “1” as the line-height property and what will it do?
Yes. It will make the line height x1 of whatever the font size is for each element
What is the shorthand for padding and margin?
margin : 0 px 20 px ;
Zero represents top and bottom margin and 20 represents right and left margin
Does order matter for border properties?
No. thin solid black is same as black thin solid
For font shorthand, does order matter?
YES.
font-style font-variant font-weight are optional but must come before font-size
When using the font property, what is not optional?
Font-size
What does span do?
Gives you a way to create a group of inline characters and elements
With the text: “My mother has blue eyes.” How would you make the word “blue” have blue text?
Put the word “blue” in a span.
< span style = “color : blue” < blue < /span >
How do you use span in CSS using classes?
Put the text inside a span element including the class
< span class = “artist” > Madonna </ span >
and write the style in CSS
. artist {
font - weight : bold ;
}
Best practice for order of “a” element states?
link visited hover focus active
A pseudo class acts like a class but isn’t a real class. T or F?
True
A CSS rule consists of a selector and a ____________
Declaration or multiple declarations
“Cascade” means the styles are coming from multiple style sheets that all fall into the page. T or F?
True
When does the “focus” state occur?
When the browser focuses in your link by tabbing to rotate through the links on your page.
When does the “active” state occur?
When the user first clicks in a link