Divs And Spans Flashcards
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 >