Example 1
<p>This is some text inside a <code>p</code> element.</p>
<p>This is <em>some emphasized text</em>. This is regular text.</p>
<p class="large"
>This is some text in class <code>large</code> element.</p>
<p class="large"
>This is <span class="large"
>some <em>emphasized text</em> in
</span> class <code>large</code>.</p>
body { background-color: rgb(80%,80%,80%); color: black }
em { text-decoration: underline;
color: red; background-color: inherit;
font-weight: bold }
.large { font-size: 2.5em; }
This is some text inside a p element.
This is some emphasized text. This is regular text.
This is some text in class large element.
This is some emphasized text in
class large.
. in .large the
rule applies only to the (non-existent) large element.
em I had to set the
background colour too. I chose to set the body's
colour and have it inherited.
em to inherit the colour.
head of the XHTML:
<link rel="stylesheet" type="text/css" href="simple.css" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
not just <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">