CSS BASIC NOTES
CSS BASIC NOTES
Chapter 0: Introduction
What is CSS?
● CSS stands for ‘Cascading Style Sheets’
● CSS is used for styling of the backbone page or the content created using
the HTML language.
● CSS is an optional language but it helps in converting an absolute simple
webpage with no styling to a very visually appealing and responsive
website.
body {
background-color : red;
}
What is DOM?
DOM stands for document object model. When a page is loaded, the browser
creates a DOM of the page, which is constructed as a tree of objects.
On the other hand, when an HTML element is given a class, it now belongs to that
class. One or more elements can belong to a single class but every element must
have a unique id (if assigned).
CSS Selectors:
A CSS Selector is used to select an HTML element(s) for studying.
body {
color : red; → Declaration (property : value)
background : pink; → Declaration
}
Element Selector:
It is used to select an element based off the tagname for example:
h2 {
color : blue;
}
id Selector:
It is used to select an element with a given id for example:
#first{