1.CSS defined display of the HTML tag specified by the attributes of the tag (font, color). For convenience, you can set all the attributes of the tag into a separate file extension is ".css" 2. CSS can be declared in various ways. You can place your CSS in the <head> ...</ head>, or burn it to a separate file with the extension ".css", plus you can also put them in each individual HTML tags special. Priority of the CSS will follow this order: - Style HTML tag placed in each separate - Style placed in the <head> - Style set the file extension .css - Style's default browser Priority will be reduced from top to bottom. 3. CSS legacy, suppose you have a tag <div id="example"> that has been declared at the beginning css file, with the following attributes: #example { width: 200px; height: 300px; } Code (markup): At a place in your css file to declare the tag <div id="example"> again, with the properties: #example { width: 400px; background-color: #CC0000; } Code (markup): After this declaration, then the tag will be <div id="example"> properties: #example { width: 400px; /* Override the previous declaration */ height: 300px; background-color: #CC0000; } Code (markup):
Thanks for this great info about CSS. I would like to share my experience here too. It's all about css snippets must be used in every html document before starting coding. * { margin:0px; padding: 0px; } It removes unwanted space between all the elements a tag we use in html.