You could add a class name, then use the double-selector to override any existing values it had. I tried it out on a few of my sites but had to give up on it because of the issues with IE6.Could you give some examples on how to solve the IE6 issue using conditional styles. To select an element with a specific id, write a hash (#) character, followed by the id … If an element has multiple ID attributes, all of them must be treated as IDs for that element for the purposes of the ID selector.Such a situation could be reached using mixtures of xml:id, DOM3 Core, XML DTDs, and namespace-specific knowledge. In the interest of being DRY, how would I write the selector to insure both are selected?Essentially what I want is to select multiple classes with multiple classes, but didn’t see that listed above.Superb. if you want to style all H1 under those Ids, you have to repeat H1 for every one as they don't share anything:You could also assign the same class to each of those h1s and style using that class.Thanks for contributing an answer to Stack Overflow! Where developers & technologists share private knowledge with coworkersProgramming & related technical career opportunitiesYou'll have to be more specific. site design / logo © 2020 Stack Exchange Inc; user contributions licensed under no class, of course, will be orange.One use I see of this is with a CMS like Drupal. You can easily apply multiple id’s to a single css style using following format: #id1, #id2, #ID3 { width:100%; float:left; } solve the IE6 problem in your box example without adding extra markup?The best explanation of specificity I ever read was That was a very helpful post as I did realise there was a difference with using a space or not.I also did not realise that you can declare multiple class names inside one set of quotation marks. What you do so much better than most is note the code, illustrate visually the code, and then give us some strategy. I didn’t know this about css selectors.I heard about this technique some time ago and loved it because it greatly reduced the amount of markup. Since I use a conditional stylesheet for IE6 anyway – this seems like a great option to go back to.Does this happen to anyone else?
Stack Overflow for Teams is a private, secure spot for you and
Thanks!I’ll have to revisit these id + class rules. Can’t wait to give this a try :)This is not a every day usage stuff, how did you found out :D This one is cool: #header.calloutWow, I was wondering where you where going with that. Let’s see the difference, what that top selector means, and exploring more of that style selector.The big point here is that you can target elements that have combinations of classes and IDs by stringing those selectors together without spaces. I am having issues learning how wp regenerates the tags you place around the loop and getting the selectors right. Perhaps green means the box has a greenish background and light green text. The id attribute specifies a unique id for an HTML element. Then some of them have color names as classes, this would be for controlling the colors used inside the box. As we covered above, you can target elements by a combination of ID and class.Target an element that has all of multiple classes. I admit the use cases for the ID versions are slimmer, but there are certainly uses. It selects based on the You’ve flipped the initial descriptions, though the graphic that follows it is right. By using our site, you acknowledge that you have read and understand our Since there are times we need the same menu system on a site twice, we can have one menu styled with the classes, and one menu over-ruled using the id. It is also used by JavaScript to access and manipulate the element with the specific id.