CSS Selectors
Whether you're a seasoned veteran or a struggling beginner, Web Radiance is the web development and web design forum for you. You'll find answers to all your HTML, CSS, SEO, and Programming needs. Pull up a chair and stay awhile.
CSS Selectors
#21
Posted 30 November 2006 - 07:02 PM
You'll often see things like id="ccf" or class="rbwt" which would be better written as id="CenterColumnFooter" and class="RedBorderWhiteText"
#22
Posted 30 November 2006 - 07:26 PM
Catalyst, on Nov 30 2006, 07:02 PM, said:
You'll often see things like id="ccf" or class="rbwt" which would be better written as id="CenterColumnFooter" and class="RedBorderWhiteText"
Red Border White Text?! What kind of meaning is that? A meaningful name would describe the content, not the appearance. What if you wanted to change to Red Text and White Border? Are you going to go back and change each instance of "RedBorderWhiteText" to "WhiteBorderRedText".
I agree that you should label things meaningfully, I just disagree with the example.
Also, I would suggestnot to use uppercase letters in class names. Instead of "CompanyName", it would be better as "company-name". This will avoid problems with case-sensitivity. [That is gleaned knowledge, but I can't remember where I read that... This article mentions it, but is not this is not the article I am recalling.]
Related: http://www.456bereastreet.com/archive/2005..._tricks_part_1/
#23
Posted 30 November 2006 - 09:06 PM
#24
Posted 30 November 2006 - 11:08 PM
So one more vote for your class or id describing the content and not the style.
#25
Posted 01 December 2006 - 12:20 AM
#26
Posted 01 December 2006 - 03:40 AM
#27
Posted 01 December 2006 - 08:38 AM
benbacardi, on Dec 1 2006, 03:40 AM, said:
That is exactly how I do it with my classes and IDs. With my image and document file names, it's always 'image-name.jpg' and 'privacy-policy.php'.
#28
Posted 01 December 2006 - 11:17 AM
herkalees, on Nov 30 2006, 08:55 PM, said:
Thats why I have a snippet set up in skEdit to do it then I can change the id names etc as needed.
This post has been edited by moojoo: 01 December 2006 - 11:19 AM
#29
Posted 01 December 2006 - 11:30 AM
<div class="article"> <h2>Title</h2> <p>Some content here........</p> </div> <!-- end article -->
This has become a recent practice of mine.
I have also started doing my filenames that way. Makes things easy to understand/remember doesn't it?
#30
Posted 01 December 2006 - 04:28 PM
I also use the functionName style, i think thats standard practice in most coding languages?
#31
Posted 04 December 2006 - 01:21 PM
This post has been edited by moojoo: 04 December 2006 - 01:21 PM
#32
Posted 24 September 2011 - 01:18 PM
#33
Posted 27 September 2011 - 10:13 AM


Help


MultiQuote












