CSS Flashcards
CSS
Cascading Style Sheets
Describes the presentation of web pages
inline styles
Duplicate code
Internal Style Sheets
Go in the head section and are defined within the style tag
Establishes link between webpages and external resources
Link tag
If there are conflicting styles
Last-read style will be used
The rules of style sheets consist of
Selectors and declarations
Selectors
Can select HTML elements based on Types IDs Classes And more
declaration blocks
Enclosed in braces
Consist of declarations that are separated by semicolon
Last declaration in a block does not have to end with semicolon
Declaration
Consists of
Property
Colon
Value
Type selectors
Find html elements based on tag
Also called element selector
With id attribute
Can create a unique identifier for an HTML element
Create ID selector
With # symbol
And ID name
Have multiple HTML element; want to select bunch of particular elements
Class attribute
Great way to apply style to multiple elements regardless of their type
An HTML element can have multiple classes
Create class selector
Full stop with class name
Link tag attributes
Type=”text/css”
Rel=”stylesheet”
Href=”path to css file”