The Benefits of CSS

Written By: Brad Markle
Experience Level: Beginner
Print E-mail:
Since the acceptance of HTML 4.0 in Decemeber of 1999 the majority of HTML based sites have been developed using CSS. CSS is an acronym for Cascading Style Sheets. CSS is designed to spearate the webpages actual content from the elements that define the actual style of the webpage. This includes many elements that defines layout, colors, and fonts. Most web developers store their CSS in a separate file and reference the file in the HTML page that is using the sytle sheet. CSS create a priority scheme to determine which style applies if more than one rule matches against a specific element. This is the cascade part of the Cascading Style sheets name. Oftern you will here references about this as inheritance, or the parent/ child relationship. This is a more advanced method of coding a webpage but is accepted by all the major web browsers on the market today.

CSS can be used in three different ways when coding:

  • External Style Sheets: This will effect all pages on your website. Once the external CSS file is referenced the web browser then loads the style sheet to control the formatting of that specific web page. If you wanted to specify that all <h3> tags have a 22px font size you would specify it here.
  • Internal Style Sheets: This will affect the style on the page that contains the style. This is stored in the <header> of your web page.
  • Inline Styles: This will affect only one portion or element on the page. If you want to format one paragraph a certain way you can use inline styling to do so.

This makes future changes to your website easy! If down the road you want to change all the <p> tags text color to blue you can do this by editing the style sheet. You no longer have to edit each page to re-format your entire website. This not only saves time but it also alllows for your code to be easily read by search engines.

For more information from InMotion Hosting, please visit: http://www.inmotionhosting.com

Advertisement