U of S | DCS | Courses | CAI | CSS | <Div> and <Span>

[Back] [Contents] [Next]


<div> and <span>


You might want to change the style of some text that is not connected to any specific HTML tag. For example, you might want text in the middle of a paragraph in green letters.

To support this, two new tags have been created specifically to add style information to text. <div> (which also leaves blank lines before and after the text) and <span> (which does not leave the blank lines). These tags can use the "style=" and "class=" attributes to assign style information to the contained text.

For example, the command used to get the green letters above was:

<span style="color:green">green letters</span>


Please send comments about this course to Kevin.Lowey@Usask.CA