Chapter 11 ■ the World Wide Web
189
Or the designer might reason that there is only one purpose that an
could have inside of one of their weather
emblems, and also only one purpose that a paragraph would serve, and so choose to decorate only the outer element
with a class.
Provo
61°F
Provo
61°F
They would now need more complex patterns to specify that they want the
and the
that live inside
a
pattern that matches the outer tag with the pattern for the inner tag.
.weather h5
.weather p
Consult the CSS standard or an introduction to CSS to learn all of the options that are available beyond these
simple possibilities. You can also read an introduction to JavaScript or a powerful document manipulation library like
jQuery if you want to learn how selectors can be used to target elements from live code running in the browser.
You can investigate how your favorite web sites package up information through two features of a modern
browser like Google Chrome or Firefox. They will show you the HTML code—syntax highlighted, no less—for the
page you are looking at if you press Ctrl+U. You can right-click any element and select Inspect Element to bring up
debugging tools that let you investigate how each document element relates to the content that you are seeing on the
page, as shown in Figure 11-1.
Figure 11-1. The Inspect tab in Google Chrome