Crowe Computer Services - established 1999

Cascading Style Sheets - Life Just Got a LOT Easier!

What was the problem?

Back in the old days of the internet, that's about two or three years ago, changing the look of a web site was a major project. Everything on the page from font size and type to the colors used was coded into the page. If you had to control the position of different parts of the page you used a table and put graphics and text in the cells. Changing how those things looked required you to change the code on each page. It worked but it was very time consuming and if you had a large site with lots of pages ...

What are cascading style sheets?

Cascading style sheets separate the content of the page from the details of layout. You create your content as you need to. You create the look and layout of the page with information that goes into a style sheet, a separate file that controls the fonts used, the size, the position and color of objects, the behavior of hyperlinks, everything. The web page calls the style sheet and applies the information to the content and the combination results in the finished page.

How do style sheets fix the problem?

Think about it. All you have to do is change one item in the style sheet and the whole site instantly changes. Every page is formatted by reference to one file. Don't like the look, try something else. You can quickly make dramatic changes. What took hours before can take a few minutes. The first time you create the style sheet, you will have to spend some time getting the look you want. After that, a small tweak creates a completely different site. Maintaining a large web site becomes a lot more manageable and enjoyable.

Life is good, right?

Yes it is, but (there's always a but), browser support was a long time coming and if someone tries to visit a site using style sheets and they are using a very old browser, the results can be ... interesting. One other but, Internet Explorer doesn't do things exactly like Netscape and other browsers so some things will have to be a bit of a compromise. The best advice is to open your page in both browsers before sending it out onto the web.

You don't have to control everything with the style sheet. If you want to experiment, start by just controlling the fonts. Make a style sheet for that purpose alone. Once you begin to understand how they work you'll put more and more into the style sheet until eventually very little is left out. It's fun. Give it a try.

 

 

Copyright 2005 Crowe Computer Services