Pre Knowledge Required
CSS stands for Cascading Style Sheets. Style Sheets is a way to separate the content from the layout on web pages. Styles determine how to display HTML elements, this is usually stored in Style Sheets. Styles were added to HTML 4.0 to figure out a problem. External Style Sheets can save you a lot of work, It is stored in CSS files. Using the CSS, HTML documents can be displayed in different output styles.
How it Works
- A style is a definition of fonts, colors, margin, layout etc.
- Each style has a unique name called selector.
- The selectors and their styles are defined in one place.
- In your HTML contents you simply denote to the selectors whenever you want to activate a certain style.
Merits of CSS
- You can set the look of pages in one place instead than repeating yourself over and over again throughout your site.
- You can easily change the design of your web pages even after they're created. Because styles are defined in one place you can change the look of the entire site at once.
- You can define font sizes and similar attributes with the same accuracy as you have with a word processor.
- You can set positions of the content with pixel exactness.
- You can redefine entire HTML tags.
- You can define customized styles for links.
- You can define layers that can be positioned on top of each other.
- Your pages will execute faster, since they aren't filled with tags that define the look. The style definitions are kept in a single CSS document that is only loaded once when a visitor enters your site.
Demerits of CSS
- There is only one demerits of CSS, It will be work on only version 4 browsers or above.