A CSS comprises of style rules that are interpreted by the browser and then applied to the corresponding elements in your document.
A style rule is made of three parts:
selector {
property:value;
}
There is no limit on the number of property:value pair that can be specified for a selector.
There are three main types of selectors:
h1 { color: red }
.hellodelhi { color: green }
<div class="hellodelhi">color: green</div> <p class="hellodelhi">color: green</p>
ID selectors: ID selectors are even more precise than class selectors, as they target only one unique element at a time. The id selector uses the id attribute of an HTML element to select a specific element. An id should be unique within a page, so the id selector is used if you want to select a single, unique element.
To select an element with a specific id, write a hash character, followed by the id="hellodelhi"of the element.
#hellodelhi { color: red;}
Others
Languages
Frameworks
Web / Design
Mobile Technology
Sql & Technology
R4R