Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Old 08-16-2009, 09:42 PM   #1 (permalink)
v7n Mentor
 
abajan's Avatar
 
Join Date: 08-08-09
Location: Barbados
Posts: 119
iTrader: 0 / 0%
Latest Blog:
None

abajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really nice
Question Is There A Valid Reason NOT To Use Shorthand CSS Notation For Colors?

For several years now, I’ve noticed that style sheets for websites, designed by whom I would consider to be well seasoned pros, contain the long hexadecimal form of color names. Why go to the trouble of typing #FFAA00 when #FA0 would suffice? And why not #fa0 instead of #FA0?

Are the longhand and ALL CAPS forms more recognizable across browsers and platforms or something?
abajan is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-16-2009, 11:23 PM   #2 (permalink)
Super Moderator
 
htmlbasictutor's Avatar
 
Join Date: 10-29-07
Location: British Columbia, Canada
Posts: 3,299
iTrader: 0 / 0%
Latest Blog:
Website Testing

htmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web pro
I personally create my CSS file manually and type the properties out, including colour numbers. So I was curious about your question so Googled for some ideas as answers to your question:

From an Adobe article:
Quote:
...A key issue to note when using shorthand CSS, is that values omitted from a shorthand CSS property are assigned their default value. This may cause pages to be incorrectly displayed when two or more CSS rules are assigned to the same tag....

...If you have styles defined in more than one location (for example, both embedded in an HTML page and imported from an external style sheet) using both the short and long forms of CSS syntax, be aware that omitted properties in a shorthand rule may override (or cascade) properties that are explicitly set in another rule.

For this reason, Dreamweaver uses the long form of CSS notation by default. This prevents possible problems caused by a shorthand rule overriding a longhand rule....
Source: About Shorthand CSS properties
__________________
HTML Basic Tutor - Learn to code your web pages/blogs
Basic Computer Information - Computer Basics for website owners

Trouble getting indexed? Maybe it's something techincal - Pm me.
htmlbasictutor is online now  
Add Post to del.icio.us
Reply With Quote
Old 08-17-2009, 05:06 AM   #3 (permalink)
v7n Mentor
 
abajan's Avatar
 
Join Date: 08-08-09
Location: Barbados
Posts: 119
iTrader: 0 / 0%
Latest Blog:
None

abajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really nice
Quote:
Originally Posted by htmlbasictutor View Post
I personally create my CSS file manually and type the properties out, including colour numbers. So I was curious about your question so Googled for some ideas as answers to your question:

From an Adobe article:

Source: About Shorthand CSS properties
Okay, so using the long form basically helps to error proof coding but what about the ALL CAPS? Is that just to help one visually locate colors quickly in bulky CSS code or are there browser/platform issues to consider?
abajan is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-17-2009, 09:12 AM   #4 (permalink)
v7n Mentor
 
Izzmo's Avatar
 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,338
iTrader: 0 / 0%
Latest Blog:
Starting p90x today

Izzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web pro
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
there is no difference between all caps and all lowercase, or even in between. That's up to you and how you want your stylesheet to look. It's the same principle in HTML when doing tags.. ie you could do <P> or <p>.

But yes, as far as shorthand and longhand, I would always use longhand. If you use shorthand, there is a possibility different browsers will handle the color different. This is especially true in Mac's.
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Izzmo is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-17-2009, 09:20 AM   #5 (permalink)
Super Moderator
 
htmlbasictutor's Avatar
 
Join Date: 10-29-07
Location: British Columbia, Canada
Posts: 3,299
iTrader: 0 / 0%
Latest Blog:
Website Testing

htmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web pro
Quote:
Originally Posted by Izzmo View Post
...It's the same principle in HTML when doing tags.. ie you could do <P> or <p>....
When coding for XHTML, elements and attributes are in lower case.

Quote:
4.2. Element and attribute names must be in lower case
XHTML documents must use lower case for all HTML element and attribute names. This difference is necessary because XML is case-sensitive e.g. <li> and <LI> are different tags.
Reference: 4. Differences with HTML 4 - XHTML 1.0 specification

Differences Between XHTML And HTML
__________________
HTML Basic Tutor - Learn to code your web pages/blogs
Basic Computer Information - Computer Basics for website owners

Trouble getting indexed? Maybe it's something techincal - Pm me.
htmlbasictutor is online now  
Add Post to del.icio.us
Reply With Quote
Old 08-17-2009, 11:16 AM   #6 (permalink)
v7n Mentor
 
abajan's Avatar
 
Join Date: 08-08-09
Location: Barbados
Posts: 119
iTrader: 0 / 0%
Latest Blog:
None

abajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really nice
Okay. Thanks for the feedback, guys.

To be on the safe side, I’ll change all of my shorthand color codes to longhand. However, my markup has always been lowercase to ensure validation because all of my sites are XHTML 1.0 (Strict). And since its easier to type all lowercase anyway, I got into the habit of typing my CSS like that too (although I have a vague recollection of reading somewhere that font names - or is it font family names? - should start with capital letters for better browser support).

Last edited by abajan; 08-17-2009 at 11:21 AM..
abajan is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-17-2009, 11:09 AM   #7 (permalink)
v7n Mentor
 
Izzmo's Avatar
 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,338
iTrader: 0 / 0%
Latest Blog:
Starting p90x today

Izzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web pro
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
I understand that, it will not validate, but it will still work. (Just stating a overall basic principle.. not validation rules or how to code correctly)
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Izzmo is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-17-2009, 12:47 PM   #8 (permalink)
v7n Mentor
 
Izzmo's Avatar
 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,338
iTrader: 0 / 0%
Latest Blog:
Starting p90x today

Izzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web pro
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
XHTML has nothing to do with CSS.

CSS, IMHO, should be uppercase for things like color-codes. But lower case for any attributes.
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Izzmo is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-17-2009, 02:33 PM   #9 (permalink)
v7n Mentor
 
abajan's Avatar
 
Join Date: 08-08-09
Location: Barbados
Posts: 119
iTrader: 0 / 0%
Latest Blog:
None

abajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really niceabajan is just really nice
Quote:
Originally Posted by Izzmo View Post
XHTML has nothing to do with CSS.

CSS, IMHO, should be uppercase for things like color-codes. But lower case for any attributes.
I didnt imply XHTML had anything to do with CSS. Its just faster to type everything in lowercase.
abajan is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-17-2009, 08:22 PM   #10 (permalink)
v7n Mentor
 
Izzmo's Avatar
 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,338
iTrader: 0 / 0%
Latest Blog:
Starting p90x today

Izzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web pro
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
True, it is.
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Izzmo is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shorthand Texting Terms - Helpful or Not? micoblanco Forum Lobby 7 08-12-2009 05:17 PM
what do think of the colors Australia Banners Graphic Design Forum 21 06-12-2008 06:06 AM
Which colors... Uban Web Design Lobby 2 01-04-2005 07:06 AM
Colors ... Atom Graphic Design Forum 88 10-30-2004 06:03 AM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 03:36 PM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.