CSS stands for “cascading style sheets“. A CSS file can contain layout, positioning, font, style, colors information for a whole web site. The file can be referenced by each html file on the site.
CSS is very useful because of the following reasons:
File Size: The html page size is very much smaller because all of the layout and style is removed from the html. By the visitor’s browser, the CSS file is downloaded and reused for different pages on a web site. Thus, this ensures a faster download for your visitors and also reduces the bandwidth requirements for your server.
Make changes to the layout: It makes it very easy to change the style of a file. We have to open our CSS file which stores the layout of the site and change the number, relating to the position of the image. This will change the position throughout the whole site. The look and layout of a site can be changed by altering the CSS file.
Search Engines: The navigation can be moved to the bottom of the source code with a CSS page, therefore instead of your navigation, the search engine displays your content.
Consistency: Position of navigation and Layout can be completely consistent across a site.
Accessibility: For visitors who prefer to modify the content or to view only the content of a web page, Separating style from content makes life very easy for them. These could those people who might use a screen reader to interpret a page.
Less code: Less code means less bandwidth consumption and easy to maintain the content. We define the property with value at a common style class and use the same class at different locations, that’s why we use less code.
Higher content to code (tag) ratio: By using CSS, we can achieve higher content to code ratio in a page because we can shift the style declarations to an external file. This is very important for search engine. We present less tag i.e style tags and more content to the spiders for indexing.
Easy maintenance: We define styles at a common place or globally, so any changes became easy. We can keep any number of one style sheets and use them according to the requirement. By using property inheritance methods, maintenance of different styles of the same tag became easy.
Flexibility: We can use more than one style but the priority is given to local styles first. We can locally assign the style to the tag and override the global style declared.
First download of pages: The page loading became fast as browsers cache the style sheet page.