Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > JavaScript and CSS

JavaScript and CSS Extensible Markup Language, Java Script, and CSS questions here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-05-2008, 05:41 AM
paul120 paul120 is offline
Newbie
 
Join Date: Apr 2008
Posts: 2
Rep Power: 0
paul120 is on a distinguished road
Default CSS Mistakes

Cascading Style sheet or CSS is one of the most used and convenient way of coding the mark up languages. Most of the websites are built on an HTML platform and hence it is important for us that the CSS is also correctly applied so that the information that the website wants to transmit to its viewers is correct. But, designers often commit fundamental mistakes that can make things go terribly wrong for a website. The css-faq.com mentions some of the common mistakes occurred in CSS.

You don't waste bytes by adding units such as px, pt, em, etc, when the value is zero. The only reason to do so is when you want to change the value quickly later on, otherwise declaring the unit is meaningless. Zero pixels is the same as zero points. In order to get the accurate choice of the color, you must specify the hex code rather than writing the color in plain English. Never forget to add hash “#” at the start of the code so that it can be parsed correctly. Otherwise, you will have to remember to add another hash to prevent errors.

Unless you are likely to be changing your code much, avoid using several lines when only one line can serve your purpose. For example, when setting borders, some people set each side separately when each border is the same. So condensing the code is required here. It is okay to style the same element twice, if it means avoiding the repetition mentioned in the point above. For example, let's say you have an element where only the left border is different. Instead of writing out each border using four lines, just use two.
But sometimes designers like to waste a lot of space in their code, by using plenty of unnecessary line-breaks or spaces before and after code. It'll only make the stylesheet bigger, meaning it'll cost you more in the long run, as your bandwidth usage will be higher. Of course it's wise to leave some space in to keep it readable, though some people like to condense everything, leaving no space at all.
Designers must be careful about some common mistakes so that they can design the web pages in a proper manner and convey the message to its reader correctly.

For more details please visit us at CSS-FAQ
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply

Tags
css mistakes



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 02:17 AM.

Contest Stats

dargueta ........ 128.00000
John ........ 127.00000
Xav ........ 107.00000
gaylo565 ........ 18.00000
Johnnyboy ........ 3.00000
navghost ........ 1.00000

Contest Rules

Ads