HTML Code Tutorial

Inline Style Sheets

Inline style sheets will override both linked and embedded settings. Certain tags like the span tag work best with Inline settings. Code placement is similar to the old method.

<p>The desired information is found on <span STYLE="font-family: Arial, sans-serif ;font-size : 10pt">Page 1</span> of the manual.</p>

Inline and Class

Inline style sheets can be especially useful when used with the Class attribute.

We can use class and the inline method to replace deprecated tags like the bold <b> tag.

There are 2 different ways to create a class. Class definitions can be defined using the linked or embedded method.
The code:
.bold{font-weight :bold }
would set bold text when used with any selector using the following inline code:
<p class="bold">This would be bold.</p>

The same class setting style sheet would work with:
<p>In this sentence <span class="bold">this is bold</span> text.</p>

Class can also be assigned to an individual tag. The code which would be placed in the head section or the linked file would be:
span.red{font-weight : bold; color : red}
and the matching inline code would be:
<span class="red">this is red</span> an



Take a Quiz on the information you just read.