Link Details

Link 1090 thumbnail
User 8 avatar

By thauvin
via designdetector.com
Published: Jun 26 2006 / 09:15

A list of common mistakes people make in their stylesheets.
  • 31
  • 0
  • 929
  • 684

Comments

Add your comment
User 194680 avatar

bonlebon replied ago:

0 votes Vote down Vote up Reply

I was looking for something like this a long time ago, thanks.

User 200845 avatar

dpm1661 replied ago:

0 votes Vote down Vote up Reply

Give me a break. More than half these "mistakes" involve stylesheet writers NOT saving a few bytes. Redundant Units? I would rather spend the 4 bytes to improve readability. At one point, the author recommends the rgb(255,255,255) format for specifying color along with the #ffffff hex format. Count the bytes!

This list would make more sense if it were detailing techniques you might use to process your stylesheet into a production file while retaining the original for maintainance.

These tips make as much sense as recommending to the content writers not to use 5 letter words when a 3 letter word would do, because you'll save 2 bytes per page load that way. Sometimes readability is more important.

User 17897 avatar

kdenehy replied ago:

0 votes Vote down Vote up Reply

Having readable, maintainable CSS is not a mistake. I'm surprised the author didn't list having comments as a mistake, since they add additional bytes to the download.

I was expecting real mistakes, such as using CSS class names like "red_subheading" or "left_menu" in which the name implies how the presentation will be. I see this all the time. What if I want to move the menu to the right? I can either change all the HTML to read "right_menu", or I can have "left_menu" be on the right. Either is dumb. Better to just name it "main_menu" (if it really is the main one) and then the CSS can even make it a horizontal menu at the top or bottom.

User 202331 avatar

guymac replied ago:

0 votes Vote down Vote up Reply

Obviously you can setup your server to compress CSS, so there is no reason not to make it as readable as possible.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.