T-XU.COM      
Home |
  Home>Computer Programming>CSS>
CSS - Maximum benefits
By Zoran Makrevski        [Hits: 21827]



What is CSS?

CSS is a simple file which controls the visual appearance of aWeb page without compromising its structure. Using CSS we cancontrol our font size, font color, link color and many otherattributes on our web page. This will make our HTML code muchmore readable and the page size will be reduced.

Why to use it and how to use it properly

If you don¡¯t use CSS on your web pages and you have many tablesand content on them, chances are that your HTML file size willbe quite big. Fact is that we live in a busy world, and peopleare not will to wait more than 5 seconds web page to load.

>From the other side some web developers implement the CSS onwrong way. They write their CSS in HTML code of the page, likethis:

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

What is wrong with this technique? Well, imagine that you havesite with more than 50 pages. One day, you decide that you wantto change font color and colors of the links on your site. Youwill have to edit ALL the pages on your site, and do to that youwill need time, because you place your CSS in your web page.

Better way is to save your visual attributes in separate,external CSS file, and to link that file with your page likethis:

<html> <head> title>My Page</title><link href="myStyle.css" rel="stylesheet" type="text/css">¡­.

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

Benefits

Which are the benefits of using CSS? List is quite long and Iwill list here only the most important.

- Your web page will load faster - Web page will become moresearch engine friendly - You can change you site appearancewithin minutes - You can write separate CSS file for handhelddevices which will be called up instead of the regular CSS file- You can forget about creating printer friendly version of yoursite using separate CSS file when user chooses to print the webpage. Avoiding standard HTML commands like: <fontcolor="#0000ff"><font size=2>Product</font>

will help us to reduce file size, but that is not the onlybenefit. Using CSS word product in this example will be movedmore close on the top of the document. Search engine will pickup more content and less code.

Imagine that you have 3 columns table on your page. When you seethe code, you will notice that first come code for your table,and after that it come your content. Positioning your 3 columnsusing CSS instead of standard inline elements:

<table width="90%" border="0" cellspacing="0"cellpadding="0"> <tr> <td width="381" height="150"valign="top" bgcolor="FFEDD4"> My Product </td> <tdheight="150" valign="top" bgcolor="FFEDD4"> ¡­..

When CSS is used, your code might look like this:

<div id="leftcontent"> My Product </div>

Again your code is much more clear, and your content is moved onthe top of your document, making your HTML page search enginefriendly, and reducing your file size.

Content is one of the most important factors in Search EngineOptimization, and you will benefit with removing the unnecessarycode in your HTML and create search engine friendly web page.

Validate it Browser war is far behind us. Reality is that mostof the people today use Internet Explorer, but you should try tobe on safe side and ensure that your CSS code is valid. Not allbrowsers interpret the CSS on same way. You can validate yourCSS here: http://jigsaw.w3.org/css-validator/


  Top Articles
*CSS: The Basics - ID's and Cla
*CSS: The Basics - ID's and Cla
*The Power of CSS
* The 30 minute CSS tutorial.
*CSS Browser Detection - The co
*Simon Says
*Using CSS with Tables
*Cascading Stylesheets: 5 Reaso
*7 Reasons Why Using CSS is a M
*Teach yourself CSS the easy wa
*Starting Cascading Style Sheet
*The Concept Behind CSS
  Related Articles
*Using CCS to Eliminate Tables
*CSS: The Basics - ID's and Cla
*CSS: The Basics - ID's and Cla
*Introduction To Cascading Styl
*CSS Print Media Tutorial
*Teach yourself CSS the easy wa
*Starting Cascading Style Sheet
*SEO Benefits Of CSS
*7 Reasons Why Using CSS is a M
*Font Organizers Review, Part I
*CSS in Flash the return of cri
*CSS Browser Detection - The co


Prev: Using CCS to Eliminate Tables   Next: CSS: The Basics - ID's and Classes ... Correct



Home | Site Map | Bookmark this site | T-XU RSS
Copyright 2007 T-XU.com - All Rights Reserved Worldwide.