Why to use CSS, its advantagesWE will discuss some advantages of using CSS Less code by CSSAs we define the property with value at a common style class and use the same class at different locations, so we use less code. Less code means less bandwidth consumption and easy to maintain the content.Easy maintenanceAs we define styles globally or at a common place so any changes became easy. For example in a site we have all the name of the products is displayed using a particular style property. Now by changing the style class at external style sheet for the product name we can change the style through out the site. We can keep more than one style sheet and use them based on requirement. With property inheritance methods maintaining of different styles of the same tag became easy.Higher content to code ( tag ) ratioWe can achieve higher content to code ration in a page by using CSS as we can shift the style declarations to an external file. This is important for search engine point of view. We present less tags ( style tags ) and more content to the spiders for indexing.First download of pagesAs browsers cache the style sheet page so the page loading became fast. The styles classes are not loaded from server each time different pages of same site using same CSS is used.Flexibility in defining style.The name cascading indicates that we can use more than one style and the priority is given to local styles first. We can override the global style declared and locally assign the style to the tag.We will use examples to learn about CSS and its uses in different tutorials here.
This article is written by plus2net.com team.
![]() | ||
| ||