HomeWeb HostingReseller Web HostingDedicated ServerResources & Support
 

Using Style Sheets in Your Web Site

Using Style Sheets in Your Web Site

How would you like to have a tool that could make your web site load faster? What if it could also allow you to make changes across your entire site with just a few keystrokes? And while we're at it, let's make it the standard for new browsers, so that your site will still work properly in the future.

Well, that tool is here now and it's called Cascading Style Sheets (CSS). CSS is the part of the code that defines the appearance of a web site.

HTML 4 is the current version of the markup language that is used to control the structure of a web page. It was created by the World Wide Web Consortium several years ago, and one of the main goals of this version was to separate the structure of a web page from its presentation.

This means that HTML is used only to create the overall structure of a web page, which includes things like headlines and paragraphs. This leaves CSS to describe what different size headlines should look like, and how paragraphs will appear on the screen.

The problem with many sites today is that they were constructed before HTML 4 had been released, or by designers who hadn't yet made the transition. These sites are more difficult to debug or update because the HTML was used in many creative ways to define the presentation as well as the structure, and it wasn't designed to do that.

They also contain a lot more code, since each headline, paragraph and other text had to have its font, font size and color defined. This extra code adds to the time it takes to download a web page into someone's browser.

These sites are time-consuming to update, as well. If you decide to make all your largest headlines red instead of blue, each one has to be changed one at a time. If enough changes need to be made, there's always the chance one will be missed, or perhaps changed incorrectly.

Make Things Simple with CSS

That's quite a bit of extra unnecessary code, especially when you multiply it by the number of headlines, paragraphs, lists, captions and links that also need this treatment. It's so much easier to define each type of text in CSS once and let all the pages linked to it use those settings.
You can now see why modifying a site would be so much easier with CSS. Without it, if you wanted the headlines changed from blue to navy, and the text in each paragraph made slightly larger, every headline and paragraph in the entire site would have to be changed individually.

With CSS, you make a small change to the headline code, another small change to the paragraph code, and your whole site is quickly and uniformly changed! This is just one simple example of the many ways CSS can be used in a web site.

Conclusion

Older browsers don't recognize all the current CSS standards, so many of its most powerful features don't work in them. As newer browsers are developed they are including more and more support for CSS standards, so in the future we can look forward to having more control over the layout and appearance of our web pages.


(Posted By Martin on Thursday, May 25, 2006)

 Read All Stories
 

 
   
 
 
» Host multiple domains in one plan
» Manage all your domains in one control panel
» Both Windows and Linux Options
» Windows Plans starting at $9.95 per month
» Linux Plans starting at $6.95 per month
» Windows Plan: MS SQL 2005 Database Included
 
Window Plans   Linux Plans
 
Close  

Copyright 2003 - 2007 All rights reserved Accu Web Hosting