What, if any, are the advantages of using CSS for ID'd controls as opposed to using class based CSS?
I, for one, prefer classes. Being predominently ASP.net, I have to tackle the old #include method using MasterPages and UserControls. The way ASP.net renders HTML in this fashion causes controls to be ID'd up in GrandParent_Parent_ControlID so as to ensure uniqueness of controls. This works and allows UserControl to have a textbox, for example, to have an identical ID to a textbox in a MasterPage, each of them are able to access their individual controls in their own code, but allowing the page and it's client-side code to access each of them on the same page
This kinda throws ID based CSS out for me as i cannot guarantee what my controls will be called until I compile and run the application and look at the markup that is generated
Anyone have any thoughts on which approach works better for them?
Currently rated 4.0 by 1 people
- Currently 4/5 Stars.
- 1
- 2
- 3
- 4
- 5