Intro to CSS Flashcards
What does CSS stand for?
Cascading Style Sheets
CSS rule set
e.g. p {
color: blue;
}
Selector = p
Declaration block = { color:blue; }
Declaration = color:blue;
Property = color
Value = blue
Selector—The beginning of the ruleset used to target the element that will be styled.
Declaration Block—The code in-between (and including) the curly braces ({ }) that contains the CSS declaration(s).
Declaration—The group name for a property and value pair that applies a style to the selected element.
Property—The first part of the declaration that signifies what visual characteristic of the element is to be modified.
Value—The second part of the declaration that signifies the value of the property.
CSS inline style
e.g. <p style='color:blue;'>Hello there!</p>
Opening tag = <p style='color:blue;'>
Attribute = style=’color:blue;’
Declaration = color:blue;
Property = color
value = blue
Opening Tag—The start of an HTML element. This is the element that will be styled.
Attribute—The style attribute is used to add CSS inline styles to an HTML element.
Declaration—The group name for a property and value pair that applies a style to the selected element.
Property—The first part of the declaration that signifies what visual characteristic of the element is to be modified.
Value—The second part of the declaration that signifies the value of the property.
How do you write css code in html?
Using the <style>
</style> element.
How do you link a css file to a html file?
Using the <link></link> element.
!Must be placed within the <head> element.!
What are the required attributes when using the <link></link> element?
e.g. <link></link>
if its a local file then instead of starting with https you would start with ./
href — like the anchor element, the value of this attribute must be the address, or path, to the CSS file.
rel — this attribute describes the relationship between the HTML file and the CSS file. Because you are linking to a stylesheet, the value should be set to stylesheet.