CSS Flashcards
How do you use inline style declaration?
style=””
What should you end an inline style declaration with?
;
How do you set the colour of an element?
color=””
Where do CSS selectors go?
the style tag
What does a CSS selector look like?
tag {
style;
}
What does a CSS class declaration look like?
.class-name {
styles;
}
How do you apply a CSS class to a tag?
class=””
How do you change the font size property?
font-size: (number)px;
How do you change the font property
font-family: font;
How do you add a “backup” font if the first is unavailable
font-family: font, backup font;
How do you set a tag’s width?
width: (number)px;
How do you add rounded corners to a border?
border-radius: (number)px;
How do you make an image circular?
border-radius: 50%;
How do you give an element a background
background-color: color;
True or False, id attributes are required to be unique
False
Though they are not required to be unique it is considered best practice to make them unique
how do you give an element an id?
id=”
How do you reference a class?
With a . prefix
How do you reference an id?
with a # prefix
What is padding?
The distance between the text of an element and the border surrounding it
What is the margin?
The amount of space between the border of an element and the surrounding elements
How do you set different amounts of padding on different sides of an element?
padding-top
padding-right
padding-bottom
padding-left
How do you use an attribute selector
[attr=”value”]{
style
}
If an element has two style classes, which will be used?
Specific beats general, the last declared class will be used
How can you prevent a class from being overwritten?
!important