CSS selectors
So we know we can use the elements type (e.g body) id or class to select what we want to style. Ok that great, but I need something a bit more than that. We it your luckily day, there is a lot more you can do. Lets start with a real life example.
So I got hundreds of web pages and they have links all over them, but I only want to apply a style to the links in the menu which has the id of menu. How can I do this with out adding a class to ever link on every web page? The solution is quite simple, and it has the wacky name of the descendant combinator, it looks like this.
You can see what I have done here. First I have selected the menu by using its id, then I have selected a this results in the style sheet finding the menu and searching for any links in it and applying the styles to those elements.
Lets again start with a real live situation and show how you can easily get the result you want with CSS.
Say I have some links <a> and some spans <span> that have the class strong. But I want to apply a rule only to the spans, how can this be done? Let me show you.
This means that the element must be a span with the class strong exactly what we want. This can also be done with ids but it not really that helpful since ids must be unique in the document. But for completeness sake here it is anyway.