Depiction- Webmaster Resources
Stock Image


Contributors: Advertise Here  |  Advertise Here  |  Advertise Here


Misc Links: Submit Tutorials (Earn $$) l Advertising l Privacy Policy | Site Map

Tutorials > CSS > Why use CSS?

 

Discover why and how webmasters are turning to CSS in order to save bandwidth, time, and more.


Cascading Style Sheets (CSS) are simple files that control the visual appearance of a Web page without compromising its structure. Using CSS one can control font size, font color, link color, and many other attributes of a web page, reducing a page's file size.

CSS is becoming widely popular among today's webmasters. Some use it only to format text, while others use it as a substitute for HTML tables. This tutorial discusses why webmasters are turning to CSS in order to save bandwidth, time, and more.

Using CSS

Without the use of CSS, one must use HTML to create all aspects of a site. In order to do this, tables upon tables must be created, to the point that your site's code becomes hard to navigate through in order to edit. When tables are used instead of CSS, there are bound to be dozens of tables in each page, increasing a page's file size and the visitor's load time. In today society, visitors want pages to load almost instantly.

Some web developers use CSS incorrectly by repeating the same few lines of code on every page.

Example:
------------------------------------------------------------------------
<html>
<head>
<title>Page Title</title>
<style>
A
{
font-family: Verdana;
font-size: 8pt;
color: black;
text-decoration: none ;
}
</style>
</head>
------------------------------------------------------------------------

By having the same code on every page of your site, your site's pages become larger when it's unnecessary. Imagine if one day you wanted to change some of these font settings. You would have to open each page of your site and make changes.

Instead, get rid of unnecessary code by placing styles in an external file.

Code:
------------------------------------------------------------------------
<html>
<head>
<title>Page Title</title>
<link rel="stylesheet" type="text/css" media="screen" href="style.css" />
</head>
------------------------------------------------------------------------

(Learn more about external style sheets.)

Using this technique, you can change the look of your site in minutes, regardless of the number of pages, because your visual attributes are saved in ONE external CSS file. Edit that file, and you are done.


Tutorial continues on page 2.


 
 

Affiliates

BioRust Photoshop Tutorials
Tutorial Man Wallpaper Stock  More

Resources