J. Blustein

Web-centric Computing

Some Example Code

CSS Example 2

HTML

  <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>

  <div class="large">
    <p>These two <code>p</code>s are in a <code>class="large" div</code>.</p>

    <p>Are they the same as the other <code>class="large"</code> elements?</p>
  </div>

CSS Rules

  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; }

Results

This is some text in class large element.

This is some emphasized text in class large.

These two ps are in a class="large" div.

Are they the same as the other class="large" elements?

(Screenshot)

See Also

Example 3 (and Example 1)

Notes

The notes for the first example are the same as for this one.


http://www.cs.dal.ca/~jamie/course/CS/4173/examples/CSS/two.html
Version:
11 Nov 2001
CS 4173 Prof:
J. Blustein <jamie@cs.dal.ca>

Valid XHTML 1.0!, Valid CSS!