CSS Coding Notes

Notes that are about CSS.

CSS

Cascading Style Sheets, language used to style to HTML content of a webpage.

Two different syntaxes

ruleset

Selector -

Beginning of ruleset, used to target the element that will be styled ex. p Declaration block - The in-between (and including) the curly braces {} that contains the CSS declarations ex. p{ color:blue; } Declaration - Group name for a property and value pair that applies a style to the selected element ex. color:blue; Property - First paar of declaration, signifies what visual characteristic of the element is being modified ex. color Value - Second part of declaration, signifies the value of the property ex. blue

inline style Writting CSS directly into HTML code. Rarely used in web design. Opening Tag — The start of an HTML element this is the element that will be styled. ex. Attribute — The style attribute is used to add CSS inline styles to an HTML element. ex. Declaration — The group name for a property and value pair that applies a style to the selected element. ex. color:blue; Property — The first part of the declaration that signifies what visual characteristic of the element is to be modified. ex. color Value — The second part of the declaration that signifies the value of the property. ex. blue

Style Attribute add the style attribute directly to the opening tag you want to style. ex. I'm blue now! To keep adding styles keep adding to the style attribute by separating each with a semicolon (;). Think of it like how when you list multiple things in a sentence like cheese, hotdogs, buns. ex. I'm BIG and blue now!

Internal Stylesheet Used for styling multiple elements. Done by writing a element inside the element ex. --CSS code goes here-- p{ color:blue; font-size:1000px; } External Stylesheet Avoid mixing code by storing HTML and CSS code in separate files. Helps keep HTML readable. Created by using the .css file name extension ex. style.css Linking The CSS File Place a element within the element of the HTML file. Tag is self-closing. Required Attributes: href - Address, or path, to the CSS file rel - Describes the relationship between the files, should be set to stylesheet ex.