Quote:
Originally Posted by Joe Pineapples
CSS is a minefield when starting out
|
To create a display of thumbnails in CSS is basically as simple as stating the width of the thumbs and the box into which you want to "pour" them. Thus instead of
Code:
<table><tr><td>linked_image_here</td><td>linked_image_here</td><td>linked_image_here</td></tr></table>
you
can have
Code:
<div>linked_image_herelinked_image_herelinked_image_here</div>
Not only is the code dramatically less, but if I want to change the number of columns, I just change the width of the div in my stylesheet and I'm done. No messing around deleting or adding td's. Almost everything from Comus to Thumbnailer can be persuaded to use divs instead of tables.
What are the consequences? Im most cases, total code will be reduced by 20%-25%, which means less bandwidth. It also means that when search engines look at your site, the ratio between content and code is improved (by more than the superficial saving, since your stylesheet should be separate and is therefore not seen as part of the page by the SE spiders) and that is good news. Less code also means faster loading, but load speed will be increased further because browsers cannot display tables until they have calculated how they should be displayed.
And there is the rub. As I mentioned in my earlier post, most people do not write good code. If people coded properly, using things such as table-layout:fixed, most sites using tables would load faster than they do. But people leave out dimensions, put things in which aren't needed which may make the browser run through some unnecessary "thinking", etc. But even if table-based designs are coded properly, they cannot load as fast as table-free designs.
It's worth people checking their sites at
http://validator.w3.org and if there are a lot of errors, they could be costing you something in terms of visitors and SE scores. If that bothers you enough to want to do something about it, does it make more sense to learn how to code well in old-style HTML or to put the same effort into current coding standards?