Indiana University
School of Library and Information Science
Information Design for the Web

Structure: Using CSS to work with images and color in html documents

Images

vertical-align

This property sets the position of images and text, relative to the text baseline

It is used with inline elements, including "replaced elements" such as images that are made into inline elements

It can be used to create subscript and superscript text

It takes six keyword values:

The markup looks like this:

.sub { vertical-align: sub;
          font-size: 7pt
        }
.sup { vertical-align: super;
          font-size: 7pt
        }

The reason for adding the smaller font-size is to make the sub- and super-script smaller than the parent text

The value can also be set with percentages, which raise and lower the child element a percentage of the parent element's line height

The markup looks like this:

.percenta { vertical-align: 75%}
.percentb { vertical-align: -75%}

Here's the positive vertical alignment

Here it is with an image: Ahnold

Here's the negative vertical alignment

Here it is with an image: Ahnold

replaced elements

This term refers elements that can be used to place non-textual elements in the page

These elements come from an external source

CSS treats these replaced elements in the same way - each has an intrinsic size and, to the browser, the content is irrelevant

This leaves only the size and the border area for CSS manipulation of images

There are three options for dealing with replaced elements:

Next!

You are here: http://memex.lib.indiana.edu/hrosenba/www/Workshops/CSS/Demo/cssimages.html
Last updated 3.15.06 - H. Rosenbaum