If you're new here, you may want to subscribe to my RSS feed. So that you can read the latest updates about Web2.0 tools, Making Money Online, Tips in SEO, Ajax and many more. Thanks for visiting ProgramimiCOM!
What is CSS? - I hear some of you ask. Well, CSS stands for Cascading Style Sheets and they have been around since the early 1990’s believe it or not.
The Wikipedia definition (changed so that it makes sense!) is as follows:
CSS (Cascading Style Sheets) is a language that describes the presentation
form of a structured document.An XML or a HTML based document does not have a set style, but it consists of
structured text without style information. How the document will look when printed
on paper and viewed in a browser or maybe a cellphone is determined by a style
sheet. A good way of making a document look consistent and easy to update is by
using CSS, which Wikipedia is a good example of.
There are many benefits of utilising CSS on your web pages. Before you skip to the disadvantages, I can tell you now that the advantages easily outweigh the bad points. Below is a short, descriptive list of reasons to make the change:
The more HTML code you use, the large the file size of the page. It doesn’t take a genius to work that one out - so the most obvious solution is to cut down on the amount of HTML (something that Yahoo! might want to consider sometime, probably saving them £100,000’s). CSS will certainly help to cut down on the amount of code you use, for example, replacing all of your <font> tags (which are now obsolete by the way) with simple style declarations.
In reducing your file size, you will in turn reduce the amount of bandwidth your website consumes each month, hopefully saving you money. Typically, a heavy HTML coded website can measure up to 80KB’s in size (without taking images or other media into consideration) - using CSS can cut down the file size by approximately 30-40% - a potentially massive saving if your website is popular. To find out how much bandwidth you would save, check out this bandwidth calculator, provided by CJ Website Hosting.
Usually, CSS code is written in an external style sheet - you can however, use inline styles. Because of this, not only will your page load faster because a) external files are cached by most browsers and b) a stylesheet loads in unison with your web page - it also makes for much cleaner, clearer code.
Still not convinced? Take the example below as hard evidence:
This code is written without CSS:
<table border="0" width="100%" cellpadding="10" cellspacing="0"> <tr> <td> <font face="verdana" size="7" color="#C71585"> <b>Welcome to my website</b> </font> </td> <td align="center"> <font face="verdana" size="7" color="#00FFFF"> My website is entirely written using HTML, nothing else. </font> </td> </tr> </table>
You can achieve exactly the same result using the following CSS…
body
{
font-family:verdana,arial,helvetica;
font-size:100%;
}
h3
{
font: bold 140% verdana;
color:#C71585;
}
#content
{
color: #00FFFF;
}
…and the following (tiny piece of) HTML code:
<h3>Welcome to my website</h3> <div id="content"> My website is written using the latest in web technology! </div>
Much nicer, I’m sure you’ll agree.
If you use an external CSS file (which I advise you to do), simply changing the style declarations in this one file will allow you to change the appearance of your entire website. For instance, in the example above, you could quite easily instruct the browser to render the heading tag to the right of the page or you could make the content wrap at 100 pixels - all by changing the CSS. Don’t get me started on what you can achieve with bulleted lists!
Visitors who are blind or visually impaired will prefer a CSS designed website far more than one not using CSS.
This is due to the fact that CSS follows web standards endorsed by the World Wide Web Consortium. Because of this, special web browsers (such as text only browsers which read the content out-loud to the visitor) can interpret the content on the page.
CSS will help make your website DDA compliant. The DDA is the Disabilities Discrimination Act, the Act makes it “unlawful for a service provider to discriminate against a disabled person by refusing to provide any service which it provides to members of the public”, specifically mentioning websites.
Another benefit of using CSS is variable font sizes. CSS will allow you to specify a font size as a percentage, doing so will allow visitors with poor eye sight to enlarge the text size. Tip: Try increasing the font size of a page by holding down ctrl and scrolling the wheel of your mouse (if it has one). You will notice that most websites do not allow you to increase the font size (unless you are using the Firefox browser which forces it) because they use pixel measurements. And those that work but use <font> tags (such as Google) are actually breaking the accessibility guidelines.
Generally, websites designed in css are accessible on all sorts of devices including mobile phones and PDAs. The majority of hand held devices will simply ignore the CSS, leaving behind a readable (but bland) web site behind. A table design however is likely to render too wide for the viewable region.
Sorry, there I go again with the acronyms. SERPS stands for Search Engine Result Pages - the set of links returned by a search engine in response to a user query.
I can imagine that some of you are thinking “pull the other one! How can using CSS make my website rank higher in Google or MSN!” - well, extensive use of tables and obsolete tags can confuse search engine spiders which crawl your website for content. Some can even confuse code with content, although the major search engines seem to be very good at stripping out every possible HTML tag or JavaScript snippet - but it takes up valuable processing power that they would rather spend elsewhere.
It doesn’t take a genius to work out that, like humans, the search engine will start reading from the top of your web page and just like humans they want to find out how relevant this page is as soon as possible - so cutting down the amount of code will make it easier for the robot to find the relevant text. Research suggests that you will also score “brownie points” with search engines for having standards compliant code that can be rendered across all mediums.
Tip: A combination of well written HTML code, fully utilised CSS and unique, well referenced content is the key to a higher search engine ranking.
As previously mentioned, there arn’t any real disadvantages of using CSS - the pros far outweigh the cons. To put it another way, CSS ‘div based’ design versus table based design is a bit like comparing Liverpool Football Club to Gresley Rovers. There’s only ever going to be one winner and everybody knows it.
So on to the only disadvantage I can think of…
Old browsers, such as the early versions of Netscape and Internet Explorer. may have a hard time displaying CSS, especially as CSS-2 is now available to use and only the most recent browsers support it.
The solution? Download the latest browser! Which reminds me of potentially one more disadvantage; giving yourself a headache whilst attempting to get your website to look identical in Internet Explorer and Firefox - doh! Oh well, practise makes perfect.
If you are interested in re-designing your website to use CSS, I would start by learning the basics. Find a simple CSS tutorial on the web and work your way through some more complex CSS examples. Then, have a go at doing your own! You will more than likely hit some problems with cross-browser compatibility but you should find help on webmaster forums such as those found at www.webmasterworld.com and www.sitepoint.com.
About the Author
James Crooke is a software engineer at CJ Website Hosting. Research interests include Object Orientated Web Applications, SEO and Accessibility in web design.
Print This Post
Email This Post
35 Responses
doggdot.us
August 19th, 2007 at 2:13 am
1doggdot.us
August 19th, 2007 at 2:53 am
2Free CSS templates - Download Free CSS Templates
August 19th, 2007 at 4:49 am
3Universe_JDJ’s Blog
August 19th, 2007 at 6:03 am
4Why you should convert to CSS
August 19th, 2007 at 7:44 pm
5[…] Still not using CSS? For those who refuse to change, here are some more reasons. Read more here […]
Shannon
August 19th, 2007 at 7:57 pm
6Nice post, but…
[quote post=”270″]To put it another way, CSS ‘div based’ design versus table based design is a bit like comparing Liverpool Football Club to Gresley Rovers. There’s only ever going to be one winner and everybody knows it.[/quote]
Uh, yeah… Wha?!
I’m kidding really. As an American, I don’t get this at all, but I love foreign cultural allusions that are opaque to me. It’s like reading a SF story.
Dabe
August 19th, 2007 at 10:14 pm
7[quote post=”270″]If you use an external CSS file (which I advise you to do), simply changing the style declarations in this one file will allow you to change the appearance of your entire website. [/quote]
This can also get you in trouble…
It’s like Einstein’s “Spooky Action At A Distance” — updating the (global) CSS for one part of your site *COULD* have unintended consequences elsewhere.
(I’m not saying you shouldn’t use CSS, but like all technologies, CSS doesn’t prevent you from inadvertently shooting yourself in the foot…)
Good CSS is obviously better than Bad HTML
Good CSS is also better than Good HTML
Bad CSS, however, is arguably worse than Good HTML.
Jared Schwager
August 19th, 2007 at 11:40 pm
8Couldn’t have said it better myself. I switched to CSS a year or two ago and I can definitely say I will never go back to using tables again. CSS is saves so much time and energy.
Max Herment
August 20th, 2007 at 1:24 am
9Friends, SF would be someone winning to liverpool :)
Max Herment
August 20th, 2007 at 1:27 am
10I think it´s difficult to adopt css because the html editors around doesn´t generate good code (even good html code by the way). There must be some kind of optimized code generator web page editor. Do you know something about one?
Mark
August 20th, 2007 at 1:28 am
11Guys… while I agree that CSS is better, don’t pull a Michael Moore and compare apples to bycicles here! Those two examples are not just a difference between DIVs and TABLE style layouts where tables by HTML definition need more HTML… but you’ve actually specified *more* attributes in the TABLE methof (i.e. the spacing for example) which isn’t in the CSS one! Bad bad bad! A more fair assesment would been to have used DIVs in both examples. Stop beeing a “Moore-on” and prove your point on the up-and-up. Again, I completely agree, but you could have made the exact same point using a fair and balanced comparison (note: Not F&B as Fox News describes it but as Websters would. :)
Max Herment
August 20th, 2007 at 1:31 am
12I think the change to CSS is difficult to adopt basically because of the bad code generation in web page editors. (even html code generation sucks). Do you know of some good editor (web page editor) that generates optimized code?
I mean short code for short pages, css instead of tables etc.
Thanks.
Beepo
August 20th, 2007 at 3:54 am
13In a perfect world what you say is true. Don’t get me wrong I use table-less CSS exclusively however you really gloss over the disadvantages.
One is time, how long does it take to throw a 2,3, or 4 column layout up using a table? A couple of minutes at most. Try doing that with CSS and you will spend considerably longer patching for each browser and then hacking in a body background all because CSS doesn’t have any concept of a column. By the way, what exactly is wrong with styling a table layout with CSS? It works, it has all the advantages of CSS that you mention except that someone who clicks on view source might think it looks cluttered.
What if engineers had the same attitude we web developers have. They would build roads that only went north-south or east-west because it is more elegant that way.
Sure, I know CSS3 will have column support but it has languished for years without being released and when it does get released it will be a couple of browser generations before it’s supported fully. I guess we can plan on our grandkids getting to use it.
everyone loves a wee sombrero
August 20th, 2007 at 4:27 am
14TechMount » Archive » Daily Friction #270
August 20th, 2007 at 8:21 am
15[…] Why you should convert to CSS - There are many benefits of utilising CSS on your web pages. Before you skip to the disadvantages, I can tell you now that the advantages easily outweigh the bad points. […]
Brad
August 20th, 2007 at 11:32 am
16nice article. But aren’t most good designers/developers already on the CSS boat?
CSS, el primer paso. « Aprendiendo CSS
August 20th, 2007 at 3:33 pm
17[…] siguiente extracto es modificado y traducido de Why you should convert to CSS. […]
5h4rk
August 20th, 2007 at 4:07 pm
18This article has been “semi-translated” into spanish.
http://aprendiendocss.wordpress.com/2007/08/21/css-el-primer-paso/
awasson
August 20th, 2007 at 4:50 pm
19@Brad: “nice article. But aren’t most good designers/developers already on the CSS boat?”
Unfortunately according to the comments above many aren’t.
@Mark: This isn’t about American pop culture. Your point isn’t fair and balanced either. Anything you can do in a table, can be done better with CSS and it will be cleaner. Dropping a table in Dreamweaver is easier/faster but a CSS solution is much more useful.
@Max Herment: Most editors released in the last 3 or 4 years will display CSS correctly in WYSIWYG/design mode but you can’t rely on design mode for the rest of your life… Dig into the code and learn CSS. That’s the only way to really excel at web development. The code generator should be you.
@Dabe: Your example is about a site that has misplaced style declarations to begin with. It’s not a problem with using CSS it’s a problem about a site that wasn’t built correctly to begin with.
CSS will reduce the size of your site and make it load faster hands down. I’ve rebuilt several sites using xhtml/css and some pages have gone down in size up to 90%. That’s a huge improvement. Using Analytics I’ve found that they are indexed faster and get better search engine results than even I expected.
It’s not easy by any stretch of the imagination but well worth the effort.
My 2 bits (and then some)
Mark
August 20th, 2007 at 6:08 pm
20[quote post=”270″]By awasson on Aug 20, 2007 | Reply | Quote
@Mark: This isn’t about American pop culture. Your point isn’t fair and balanced either. Anything you can do in a table, can be done better with CSS and it will be cleaner. Dropping a table in Dreamweaver is easier/faster but a CSS solution is much more useful.[/quote]
You obviously didn’t read my comment, or if you did, you’re not qualified to comment here yourself because if you were, you’d see that my complaint had nothing to do with using tables vs. divs, it had to do with comparing the two different methods, then calling it a CSS difference. You can use CSS just fine with either tables *or* divs. You want to compare CSS uses, then do one TABLE example that uses CSS, then another TABLE example that doesn’t… then do the same thing with DIVs. Doing what this author did, while I agree with the design practices, doesn’t just cover CSS, it covers different ways to layout a page… again something that’s not the topic of this article., which is CSS Had it said ‘Better layout techniques’ and listed CSS as *one part* of it, I’d agree. But if you are extolling the virtues of CSS, then make the comparison with or without CSS and make that the *only* difference.
Again, what’s the topic of this argument? CSS! The example shows something that’s not as clean, but does so by using two different and CSS-unrelated HTML tags–both of which can *use* CSS, but neither of which *depends* on it.
So I disagree… it’s not only fair and balanced, but logically sound too.
Moore-on! [smirk] Just kidding! But I hope you do get my point now. Again, I agree with the author, but I disagree with his choice of example because it requires Moore (ok, I’ll stop) than just what he’s stating.
Max Herment
August 20th, 2007 at 6:17 pm
21Mr. Awasson
I think you are absolutely right. In the end I´m a programmer and not a web designer. Then I´ll have to make a shift in the way I think about web design. I´ll start to see it as a computer language instead of a drawing system or design program. Seeing it from this point of view gives me new strategies. Now I won´t design a page, I will program it. The difference (even subtle) is that now my pages will be dynamic from the beginning allowing less text to do more (I mean html text) trough a good mix of dynamic html (jscript) and letting the formatting to an external css.
There´s only one thing left: Is there a form (a way, a method) to avoid completely the html tables in css?
I say that because html tables are very limited to be programmed and changed even with dynamic html.
I´d like to create the typical menu page with contents changing. but I don´t want the menu page be re-created in every page. I don´t want to use frames (this is worst). Is that possible using css and no tables?
I’m not pretending to have a complete answer here, just some place to go to learn that. I mean some kind of advanced css tutorial.
Thanks in advance. Sorry for my english it’s terrible I know.
Thanks anyway
Max.
Mark
August 20th, 2007 at 6:21 pm
22I just noticed there’s also centering in the HTML example which isn’t in the CSS one, just like the padding isn’t either; again furthering my case that it’s not a good comparison and only takes away from what actually *is* a good point!
In other words, the author’s statement “You can achieve exactly the same result using the following CSS…” is in fact wrong and therefore doesn’t support his argument and worse, actually contradicts it.
I’m just saying compare apples to apples! Show an example that produces the *exact* same result using CSS vs. not using CSS.
In other words… good point; bad example. Just change it and I’ll shut up!
Mark
August 20th, 2007 at 6:27 pm
23[quote post=”270″]…Dropping a table in Dreamweaver is easier/faster but a CSS solution is much more useful.[/quote]
Oh yeah… for real web programming, I do most HTML/CSS coding by hand in something like TextPad. I don’t even have DreamWeaver installed, let alone use it so again, cleaner HTML/CSS is actually even more important for developers like myself. It means less work for me. No need to bring in ‘new’ facts that aren’t part of the discussion, let alone applicable.
Joe Levi
August 20th, 2007 at 7:09 pm
24This would have been a great article in 1997… maybe even 1999… but this is 2007… if you’re writing web pages and don’t know about CSS it’s time to find a different profession/hobby.
What’s next? “Why writing properly formatted xHTML is a good idea”?
ProCOM
August 20th, 2007 at 8:47 pm
25Well, Thank You all; all of you for your comments.
First of all I wanted to rectify something here. If you have a look around on this web site, you’ll notice a great amount of “old stuff” as geeks use to say, well this is because this web page was dedicated formally to the Albanian web building community. For those asking themselves “What Albania means?”, shortly I can say that Albania is a country in The Balkans, Europe. If this doesn’t ring any bell, than remember President Bush’s wristwatch being stolen theory (anecdote)?… Well, thats the country I am talking about. If this still doesn’t ring any bell, than follow this link; there are plenty of informations about Albania. I am not going here to make this comment all about my country.
Now, back to our “discussion”; yes, sure it is “old news and stuff”. CSS had been around till ’90s, right? I posted this article here mainly because this web site serve as a “information point” to Albanians (your question plebeian), and I am glad, very glad that now it serves more internationally. And yes, I was out for the weekend and I don’t know exactly what happened or when, but it was not a bandwidth problem; all that I can say is that it was a testing script I left activated on server, because this article making the digg.com frontpage was the only thing I didn’t think about (Maybe this answers Ant Dude question on digg.com). Yes, thank you Neil Martin, you are right, I didn’t created this blog and thinking “Oh man, this site is so gonna get dugg. I think I’ll go for one of those really expensive bandwidth plans”.
Hmmm, Epixx, it’s a great idea, can I borrow it, please? our next article will be “How to “unleash” the power of your phone lines through a 56K connection” and Joe Levi, I fully respect your opinion, maybe next week article will be “Why writing properly formatted xHTML is a good idea?”… C’mon people, let me give you some statistics; you know that more than 80% of Internet connections in Albania is done through 56k phone modem??!!! Do you know that very few, but really, very few web development people in Albania knows what is AJAX, DHTML, CSS and other things like that? Just a week ago, someone I know emailed me a link with her new homepage (hosted on geocities) and there was nothing more there than plain HTML, and; yes, it’s a tragicomedy but she used the “BLINK” code on that web!!!!! You are talking about Web 2.0, and predicting Web 3.0, but do you know that in Albania a maximum of 100 people (my estimate) knows what does that mean? Well, I’m lucky enough to be a little more “advanced”, what I am supposed to do?! Continue without turning my head back?! No, sorry. I can’t do that. That’s my people and my country, and I am morally obligated to do whatever I can to help. If this means I will be “recalled to reality” by someone helping me to remember what year we are living, sure, I will be more than glad to hear that opinion. Thank you mrRB, I know “It’s 2007; Two Thousand; and frakking Seven!” I watched Battlestar Galctica, but, you know; it’s 2007, every operating system has a calendar… Anyway, I beg pardon, Sorry for speaking Latin to Romans.
Back to CSS, just have a look around, you’ll notice many and many web sites, still not using CSS. In the year of “Web 2.0″ talking about CSS is obsolete; right? Well, web 2.0 is a concept, not a technology, nor system, forget about being a Markup Language. Than what is Web 2.0? A concept, a “buzzword”; do you want my opinion about it? Follow this link; a photo is worth more than a million words together…
I’ve decided to write a whole chain of articles; a saga about Web 2.0 and the future of it. I will divide it on four parts; one part every two or three days, so if this a “2007 talk”, than just stay tuned.
Qooqle News
August 20th, 2007 at 9:57 pm
26Css Globe | Web Standards Magazine
August 21st, 2007 at 10:18 am
27links for 2007-08-21 : Christopher Schmitt
August 21st, 2007 at 9:20 pm
28[…] Why You Should Convert to CSS It’s been a while since I had to convince anyone of switching to CSS. Are we still in the 90s? (tags: css webdesign design web tutorials html seo) […]
links for 2007-08-22 « Simply… A User
August 22nd, 2007 at 1:47 am
29[…] Why you should convert to CSS (tags: css design web tutorials webdesign *) […]
Weekend Links - jQuery 1.4, CSS Images, Printing Techniques, Converting to CSS, Cross-Browser Coding | BluDice Blog :: PHP, MySQL, CSS, Javascript, MooTools, and Everything Else
August 25th, 2007 at 9:50 pm
30[…] Why You Should Convert to CSS Anyone who hasn’t switched to CSS really should — there’s no advantage to not doing so. In case you haven’t, this is a good read. http://www.programimi.com/2007/08/18/why-you-should-convert-to-css/ […]
Why you should convert to CSS « Design News
October 2nd, 2007 at 1:05 pm
31[…] read more | digg story […]
Coolness roundup #4 : CSS Resources -- flisterz:blog - life, reviews, technology, wordpress, design, CSS and anything!
November 4th, 2007 at 9:49 am
32[…] You dont know what am I crapping here? wtf is CSS? maybe you want to read this […]
Bloglah.org: Malaysia bloggers community
November 4th, 2007 at 3:23 pm
33Convert Css To Html
March 11th, 2008 at 7:54 pm
34Weekend Links - jQuery 1.4, CSS Images, Printing Techniques, Converting to CSS, Cross-Browser Coding
March 13th, 2008 at 7:47 pm
35Comments RSS
TrackBack Identifier URI
You must be logged in to post a comment.
Blogs We Read
Recent Articles
Recent Comments
Tag Cloud
awoid build business create CSS design earn engine firefox free fun google guide help how How To HTML income increase Internet make Make Money mistake money mozilla navigate online pages Quick Tips revenue search Security server site ssh strange facts tempates tips to traffic true tutorial WEB website WindowsOptions
Pages
Categories
Entries (RSS) and Comments (RSS).
Copyright 2007-2008 © ProgramimiCOM - Names of companies and products mentioned herein may be the trademarks of their respective owners.• Powered By ShqipoNET