J. Blustein

Web-centric Computing

Some Example Code

Experiments with CSS Selectors
#1 Using sibling selectors (span + span)


  <p class="example">

CSS Code

  span         {font-variant: normal}
  p.example > span:first-child
               {font-size:550%; font-variant:small-caps}
  span + span  {font-size:smaller}

What it looks like in this browser

Using sibling selectors (span + span) ...

Quick brown fox jumps over the lazy dog.

... the size is always relative to default size (in the <body>).

What it looks like in Netscape 7

large QUICK (in small caps), normal-size for the rest

Where To Next?

27 November 2003
CS 4173 Prof.:
J. Blustein <jamie@cs.dal.ca>

This document is written in valid XHTML 1.0 &
This document makes use of cascading style sheets