There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply () below.
If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.
Join the Discussion. Help a fellow learner on their journey.
Ask or answer a question about this exercise by clicking reply () below!
You can also find further discussion and get answers to your questions over in #get-help.
Agree with a comment or answer? Like () to up-vote the contribution!
In the exercise, the elements with the tag <h2 class='destination heading-background'> have two classes. One class is destination while the other class is heading-background. Even though both the classes are written in the same quotes, the space between the two class names makes the classes separate. An underscore or dash can be used to write a single class name comprising of two words e,g. heading-background.
In index.html of the exercise, there is an element <h2 class='heading-background'> More Destinations </h2>. This element has only one class.
If we want to target the h2 elements having the destination class, then h2.destination is sufficient to target the desired elements.
hey everyone!
New to the course, I’m curious about something, does chaining have any advantages over the previously mentioned attribute selector?
in the chaining page, the answer is supposed to be
h2.destination{
font-family: Tahoma;}
I tried using the attribute selection method:
h2[class*=‘destination’]{
font-family: Tahoma;}
and as far as I can tell, both work. Are they mutually interchangeable? I did notice though that the chaining methode seems to supercede and override the attribute selection method when both are place in the stylesheet!
Any insight about this topic would be very appreciated
I noticed Chaining and Descendant aren’t more specific from one another, so I guess my question is it safe to say which ever one will compute will depend on the order we list them on the style.css?
I didn’t have a tahoma typeface font installed on arch linux firefox, so even though I did the exercise right and passed it, the font didn’t change. I had to install the aur package ttf-tahoma for it to work. This is a free replacement from the Wine project. Another workaround is to try another font-family like monospace
I am also new. But I have seen another example in CodeAcademy CSS cheatsheet on the selector specificity, which is type#ID. Personally, I don’t think that’s a practical way or recommended way to use since it is generally better to have a unique ID on a single page for whatever types. But it is allowed to use type#ID chaining if you really need it.
then chaining will override the attribute selector but if chaining is arriving first then attribute selector then attribute selector override the chaining method.