You specify more than one aspect of a style at a time by just stacking all the specifications together. The semicolons at the end of each specification serve to separate the specifications. For example, let's say we want a light yellow background and red text for a warning message:
<span style="background-color: #ffffcc; color: red;">Do not operate this device underwater!</span>
Here are the results:
Do not operate this device underwater!
How about eighteen-point Helvetica font in magenta? That's a fairly long specification, so it's sometimes easier to split it across several lines. Remember, HTML doesn't care about extra whitespace.
<span style="color: magenta; font-family: Helvetica, Arial; font-size: 18pt;">Large bright purplish text.</span>
Which looks like this:
This brings up a question: what if you're writing an on-line user manual and you have five or ten warnings on a page, or if you need that big magenta text seven times on a page. Is there a way to avoid having to retype or copy-and-paste those definitions? Yes, in fact, there is. You can collect all your styles into a stylesheet and refer to them by name.
Specifying Background Color | Index | Stylesheets and Classes |