Cascading Style Sheets (CSS) Local or Inline Format

Inline Style Sheet allows the designer to add styles to any individual tag. Each tag uses the attribute STYLE with style properties and values in quotes. Multiple rules are separated by semicolons. Use double quotes to start and end the rules.

Style Sheets can be applied to large blocks of text using the Div (Division ) block level tag and to emphasize several words use the SPAN inline level tag.

Inline Style Format:

<XHTML element  style="CSS property : value; style2 : value">

Applying inline style rules to a header

Header text formatted using inline style rules.

The header h2 text has a font-size:16px; color:brown; font-family:Times New Roman

Applying inline style rules to Paragraphs

<p style="background-color:#ffff99; font-size:16px">This paragraph text has a yellow background color applied and a font-size:16px. The font family was inherited since it was not specified.</p>

This paragraph text has a yellow background color applied and a font-size:16px. The font family was inherited since it was not specified.

Applying Images to List

<ol style="list-style-image:url(images/smiley.gif)">

  1. Roses
  2. Tulips
  3. Lilies

Learn to use Div and Span Elements to apply styles.

Web Design with XHTML Part II
Prince George's Community College
Doris Cuffey, Instructor