nettuts.com — Working with CSS can seem like a constant battle. Browsers are always changing they way they read the code (*cough* Internet Explorer *cough*), and it seems that there are lots of tiny little CSS "gotchas". While it's an incredibly powerful language, it can easily be used incorrectly, which will doom your development to a lifetime of imperfections.
Nov 12, 2008 View in Crawl 4
hantataNov 12, 2008
Yes, all the time.
elementopNov 12, 2008
As long as you never have to maintain or modify your site *and* you are only using a single page on your site, using tables and font tags is probably quicker. However, if you ever decide to redesign your site while keeping the existing content, or if you ever have to build a multi-page site that has a consistent look and feel to it, CSS will pay you back big time.My very first "large" web site, a web-based aircraft scheduling project for a fictional flight school (my senior project in college) was completely hand coded using tables and font tags because I didn't know CSS even existed. It took forever to code and was horrendously large because I used tables and font tags to lay everything out. I could rebuild that entire site now using CSS and it would probably half as big and 1/10th as complex.Seriously, just take the time to learn CSS. You will be glad you did...and so will anyone else who ever has to maintain your legacy projects.
7ajiNov 13, 2008
Isn't the time to finally stop caring about IE's bad interpretation of the code?(funny it says above the comment box (No HTML please) XD
pinkythewinkyNov 13, 2008
re Number 9: If you have one element on one page that has to have one particular look, then inline CSS is better than making a class you'll only use once. Otherwise your CSS becomes bloated with one time use crap. This is a useless article and most of it is noobish and obvious. Buried for lame.
avengexNov 13, 2008
Though I agree with the presentational issue, what with .left, .right, and what have you, what happens when you're in the scenario of WYSIWYG editors in a CMS for example, or dropping images into your content? These are some instances when there's no way to avoid having to use .left, .right, .clear, .center, .centre.. and so on.That said, I always prefix said classes with img so they only work with the image element. It makes me feel a bit more pure.If you think you can do it better, drop me a message.
speerrossNov 13, 2008
Nothing revolutionary here, but these mistakes I see all too often if I take a peek at some source code. I don't even do design or development as a full-time job and I've got in to the good practice of not making these mistakes (apart from not checking in IE until it's all done) but it seems almost every 'professional' site out there is guilty of at least several of these.
jaygeezeDec 10, 2008
The source code formatter they're using (it looks like the dp.SyntaxHighlighter) is borked, like seen in float:rightright; Anyone else experience this issue (using FF 3).Also LOL at "don't use too many CSS files" suggestion: why are there 4 CSS includes in this page then (not including the conditional comment hack to serve a special stylesheet for ie6)?