TA made the following point in another thread about vB:
I didn't want to derail that discussion so figured I would make a new thread since this is a topic that comes up a lot.Originally Posted by the_ancient
TA, you have to understand that I had a similar mindset as you. I've been doing web design since about 1998 (probably earlier) and when I started there were no standards (can't call front page a standard, can we?). Back then everything was nice and easy, you could count on 95% of your user base using IE and you really didn't have to give a crap about any other browser. In addition for me personally I never had to worry about others having to deal with my HTML back in those days. So when people were telling me coding in tables was bad I would throw a fit, plug my ears, and stick to my bad habits.
But times have changed. I just took a quick look at my stats and in the last month and only 46% of my visitors were using IE, 40% using firefox, and a whopping 8% using opera. Contrary to TA's point CSS layouts are the most efficient way of making your web sites cross browser compatible. If you can get your CSS and HTML to validate 99% of the time your web site will display in all modern browsers properly.
In addition to cross browser compatibility using CSS makes your layouts a crap load cleaner and much easier to work with. In C++, PHP, Perl, labVIEW, or any other programming language writting messy code is looked down upon. HTML is not an exception to this rule. Not only do you need to be able to go back and know how your code is layed out after time has passed but others might have to also. To back up my point I will leave with this example:
using tables:
but in reality we would actually have to nest those tables for more complex designs:Code:<table> <tr> <td> Column 1 </td> <td> Column 2 </td> <td> Column 3 </td> <td> Column 4 </td> </tr> </table>
and this is what that code would look like if done properly in CSS:Code:<table> <tr> <td> <table> <tr> <td> Column 1 </td> </tr> </table> </td> <td> <table> <tr> <td> Column 2 </td> </tr> </table> </td> <td> <table> <tr> <td> Column 3 </td> </tr> </table> </td> <td> <table> <tr> <td> Column 4 </td> </tr> </table> </td> </tr> </table>
So don't be afraid to get your feet wet with CSS. Up until the beginning of this year I certainly was. But after doing my first CSS layout I could not look back. And after about 8 months of strict CSS programming, layouts that would have taken hours to code before take a fraction of the time. And I don't have to worry about previewing my layouts in all the different browsers out there. If it looks right in IE7 and Fire Fox2 it will be sure to look right in every other standards compliant browser including Opera, FF3, Chrome, Safari, etc, etc, etc.Code:<div style="float:left;">Column 1</div> <div style="float:left;">Column 2</div> <div style="float:left;">Column 3</div> <div style="float:left;">Column 4</div>
The point of CSS is not to replace the use of images. The point of CSS is to actually make laying out images in your design much easier. What you would have to use countless nested tables for can now be done in a single CSS definition.Code:But hey here is challenge, if CSS is so great create some CSS definitions that replace the images in use here........(or come close)


LinkBack URL
About LinkBacks




Reply With Quote


Bookmarks