Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing from ID to Class

Status
Not open for further replies.

Nevermoor

Programmer
Jul 25, 2003
218
US
I am trying to implement a nested menu adapted from but am having problems because setting two nested menus to the same ID means my page no longer validates as HTML 4.01 t. I tried changing id= to class= and changing # to . in my style sheet, but that doesn't seem to work.

The only other idea I've had is to somehow apply the styles intended for the secondary menu only to unordered lists within unordered lists within the container div. Is that even possible in CSS 2.0?
 
You shouldn't have any problems if you change the id to class. From the CSS perspective, both selectors are equal, so your problem must have been somewhere else. Maybe you failed to change all the occurances of the id (#) selector in CSS.

As for your other idea, it is possible.
Code:
div#container ul ul {
  /* this applies to unordered lists within unordered lists within div with id="container" */
}
 
Awesome... ul ul worked, and makes better semantic sense.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top