Jump to content
  • Advertisement
Sign in to follow this  
Lucidquiet

[web] CSS ID/class

This topic is 4156 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello: During development of a web application the server side and javascript use a number of ID's to make controls and access elements. Is it a great inconvience, or not possible, to use nothing but classes for the visual design? It seems if it is possible then it would be best if the visual designers stayed away from IDs and the content developers could stay away from inline styles and classes... Do visual designers really need IDs? L-

Share this post


Link to post
Share on other sites
Advertisement
You could make your entire site just using classes easily enough. The whole point of ID's is that they are meant to be assigned to unique elements, such as elements which affect the pages structure. I find its generally good practice to include them, as it helps further distinguish layout from content.

Share this post


Link to post
Share on other sites
To add to Sonnenblume's comments, example of ID based elements would be #header, #left, #content, #right, and #footer. Of course you can add as many ID tags as you want, but don't duplicate them as it defeats the purpose of having unique identifiers on specific elements.

Share this post


Link to post
Share on other sites
I have worked on projects where we had to use all classes in order to not interfere with the IDs which were pumped out by a .NET framework. Just use classes with the same strictures as you would use IDs and nothing will be different.

Share this post


Link to post
Share on other sites
Quote:
Original post by Mathachew
To add to Sonnenblume's comments, example of ID based elements would be #header, #left, #content, #right, and #footer. Of course you can add as many ID tags as you want, but don't duplicate them as it defeats the purpose of having unique identifiers on specific elements.


Couldnt put it better myself :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!