CSS Flashcards
What does CSS stand for?
Cascading Style Sheets
How is CSS applied to HTML?
An HTML Link Tag
What are the two ways CSS can be applied to HTML?
- Ruleset
- Inline
What is the ruleset application of CSS?
A ruleset is defined either within the HTML document itself or in a sperate file with the .css extension.
What is the inline application of CSS?
CSS that is applied using the ‘style’ attribute in the HTML directly.
What are a few instances where inline style is commonly used?
- The style being applied to the markup is unique and won’t be repeated.
- The HTML markup is dynamically generated, and the CSS is static.
- Other situations where styling isn’t possible from a sperate file
What are the Ruleset Terms? (SDDPV)
- Selector
- Declaration Block { }
- Declaration
- Property
- Value
What are the Inline Style Terms?
- Opening Tag
- Attribute
- Declaration
- Property
- Value
When using the inline styling, how many styles can you add?
As many as you want, just keep adding the style attribute. Make sure they end with a semicolon every time.
Does the style attribute use double quotes or single quotes?
Either, just like any other attribute. (I totally knew this before I started learning CSS)… (totally)
How do you create an internal stylesheet?
Use the ‘< style >’element nested within the ‘< head >’ element. Once created you can code in CSS.
Where does the link to your CSS code need to be in the HTML?
Nested cozy inside of the ‘< head >’ element.
What two attributes does the ‘< link >’ need to have in order to work properly?
The ‘href’ attribute designating the location, and the ‘rel’ attribute describing the relationship, which in CSS’s case it’s ‘stylesheet’.
How do you decide which elements get a style?
A selector
How do you decide what style is applied to an element?
A declaration
What selector takes straight from the element in HTML?
The type selector. Also referred to as the tag name or element selector.
How do you select to style everything?
The universal selector which is denoted with a ‘*’
How do you select a class attribute in CSS?
Infront of the classes value, add a ‘.’
How can you create a correlation between multiple classes in HTML and CSS?
In the HTML class attribute add the values of the corresponding CSS styling. So ‘class=”bold green” in HTML and ‘.bold’ + ‘.green’ in CSS
What do you give an HTML element if it needs to be styled uniquely?
Give it the ‘id’ attribute. The id attribute’s value can only be used once per page.
What do you prepend the id with when styling in CSS?
Use the ‘#’ sign
What type of selector selects based off attributes?
An attribute selector
What surrounds an attribute when using the attribute selection method in CSS?
Brackets: [ ]
In CSS what is the syntax for selecting not only an attribute, but it’s value as well?
type[attribute*=’value’]