In the preceding chapters, we used a number of selectors, most of which select elements by their type (for example, H1 or P). This chapter describes all the possible ways in which elements can be selected, from simple ones, such as the type selectors, to advanced, such as selectors that look for elements with a combination of characteristics.
We start with the simple selectors, and most common ones, and show how they can be combined into powerful – but still simple – selectors. The second half of this chapter discusses advanced selectors.
To give you enough freedom to select which elements a style is applied to, CSS2.1 supports four selector schemes. Each is based on some aspect of an element:
• An ...