with it that specifies underlining, any <p>elements within that parent
<body>element inherit the underlining. However, if more specific styles
exist on the Web page (such as an inline style), they override the inher-
ited style.
CSS styles contained within an HTML document (embedded or inline
styles) take precedence over external styles (located in a separate .css
file and referenced in the HTML code with the <link>tag).
A style with an !Importantcommand takes precedence, regardless of
other factors.
Now, just for fun, try an experiment. Modify this embedded style strongin
the Word-generated HTML code by following these steps:
- In the Microsoft Script Editor, locate this selector:
strong {color:#400000;} - Modify it in the Script Editor to make the color of green, by
changing it to this:
strong {color: green;} - Now locate some text in the first paragraph — the text of your docu-
ment is at the very bottom of the HTML in the Editor. Surround a
word or two with the tags, like this:You’ve experimented
with
Notice that once you type theThis is to cue you that there is an error in the HTML code. As soon as
the code is restored to the correct format (when you type the end >
symbol), the text turns black again, signaling you that all is now well.
Or if not entirely well, at least your HTML code doesn’t have a glaring
error in it.
Before saving this file, notice something cool happening in the Word
document. Switch to Word now. See the Refresh toolbar as shown in
Figure 3-5? Word knows that you’ve edited the HTML, so the current
Web layout view is no longer accurate.
- Click the Refresh button on the toolbar.
You now see the words that you tagged <strong>have turned green,
just as your modified style specified.
- Choose File➪Save.
The HTML file is now updated to reflect your changes.