CSS for Beginners
CSS is a type of language used to style webpages. CSS styles t allows us to add layout and design to our pages, and it allows us to share those styles from element to element and page to page.
Selectors
CSS uses selectors to apply styles to the HTML elements in a web page. For example p {} selects all the paragraph elements within the HTML document and applies the styles to it. There are three types of selectors: elements selectors class selectors id selectors. For example: class selectors use a period infront of the class name. .logo {} selects all the logo classes. id selectors use a # infront of the id name. For example #logo {} selects all the logo classes.
Properties
CSS uses properties within selectors to determine which styles to apply to the HTML elements. For example : p { background: green; } In this example the background property applies a background to all paragraph elements.
Values
The properties accept values specific to the properties. For example: p { color: red; } In this example the color property has a value of green.
The Cascade
Within CSS, all styles cascade from the top of a style sheet to the bottom, allowing different styles to be added or overwritten as the style sheet progresses. This allows different styles to be applied and overwritten.