CSS Flashcards
(348 cards)
What are the ‘methods’ for writing CSS called? / what is the word for any coding language’s ‘language’?
syntaxes
Give two types of syntaxes for CSS / two ways of writing and applying CSS
ruleset in CSS
and
inline style (used in HTML)
What do all CSS syntaxes use?
declarations
What do declarations do in CSS
apply style to the selected element
What is the extension for CSS files?
.css
How do you write CSS within an HTML file?
by enclosing the code in a style tag < style >
Define this Ruleset(.css) syntax term: selector
selector {
}
the beginning of the ruleset used to target the element that will be styled
Define this Ruleset syntax term: declaration block
the code in-between (and including) the curly braces { } that contains the CSS declaration(s).
Define this ruleset (.css) syntax term: declaration
the group name for a property and value pair that applies a style to the selected element
Define this Ruleset syntax term: property
The first part of the declaration that signifies what visual characteristic of the element is to be modified
Define this Ruleset syntax term: value
the second part of the declaration that signifies the value of the property
Define this Ruleset inline style term: opening tag
the start of an HTML element. This is the element that will be styled
Define this Ruleset inline style term: attribute
the style attribute is used to add CSS inline styles to an HTML element
Define this Ruleset inline style term: declaration
the group name for a property and value pair that applies a style to the selected element
Define this Ruleset inline style term: property
the first part of the declaration that signifies what visual characteristic of the element is to be modified
Define this Ruleset inline style term: value
the second part of the declaration that signifies the value of the property
How do you close off inline style attributes?
With a semicolon ;
Are inline styles the best way to style HTML?
no
What is the CSS code written/nested within the < style > element of HTML called?
internal stylesheet
Where must an internal stylesheet be placed?
Within the < head > element
Why is an external stylesheet useful?
because you don’t have to sacrifice the readability and maintainability of your HTML code
When using an external style sheet (.css file) what must you do?
Link the .css file to the .html file
How do you like a .css file to a .html file?
with the < link > element, which must be placed within the < head >
What two attributes does a < link > linking a .css file to a .html file need?
an href=”” which links to the .css file
a real attribute, which describes the relationship between the HTML file and the CSS file