Can one of you CSS experts explain this designator (if that's even what you'd call it) to me? I understand the contents, just not the a.button.gold. Two dots?
a.button.gold{
background-color: #b9972f;
}
I am trying to modify a couple of styles on a Wordpress theme and would have a lot more success with it, if I could figure out what is currently happening. Thanks
The selector simply means select any
a
element having class.button
AS WELL AS.gold
so your anchor tag should look likeDemo
The selector can be also written as
element[attr~=val]
as @BoltClock Commented likeDemo
Generally the above(Not the selector, but calling multiple classes for a single element method) is also used when you want to apply properties of 2 classes to a single element, so say for example you have
.demo
havingcolor: green;
and.demo2
havingfont-weight: bold;
so usingWill make it green as well as bold. Demo 2
This selector represents an
<a>
element with two classes, as you can have as many classes (separated with a white-space in the class attribute itself) in CSS as you'd like. The HTML would look like:If the
<a>
had three classes you'd just continue the pattern:http://jsfiddle.net/NeqAg/
This means, the background color specified will be applicable to all
<a>
tags whose "class" attribute has a value of either "button" or "gold".For example, if you have a tag
and another tag
then, the background color for both the classes will be the same specified one.