Implementing Styles

Like javascript, CSS can be linked to xhtml in three main ways, as an

You can even use all three methods at the same time.

Although we will show you the Inline and Internal methods use of External stylesheets is the recommended method.

1. Inline Styles - the css is placed inside an html tag using a Style Attribute
Here is an example of inline css that colours the text in a span tag.

<span style="background-color:gray; color:white;border-style:ridge;padding:3px;"> some text </span>

and here is how that looks some text

Note the structure of the style attribute. It contains several property and value pairs.
style='property:value;property:value;'

As you can see there are some new properties you might not have come across before, in fact there are lots !
So don't forget to check out the Cascading Style Sheet Reference Guides mentioned earlier