Create a website RSS feed

Formatting Using CSS

Formatting Using CSS

Last update on: 05-17-2008
In this section we talking about using the style attribute which can be used with most tags. It a way to control how the browser renders HTML tags (or elements, as they're called in standards documents). However, most tags somehow affect the appearance of the text that they enclose. There's a tag that doesn't have any inherent effect on the text that it's wrapped around: the tag. It exists solely to be associated with style sheets. It's used exactly like any of the other tags you've seen today. Simply wrap it around some text, like this:
<p>This is an example of the <span>usage of the span tag</span>.</p>
Used by itself, the <span> tag has absolutely no effect. Paired with the style attribute, it can take the place of any of the tags you've seen today and can do a lot more than that as well.
The syntax - How to use it?

With one propriety:

With two or more proprieties: Just add a semicolon before you close the attribute and type the second propriety with its value (here we added the font-size for 11 pixels) and so on

The Text Decoration Property
The text-decoration property is used to specify which, if any, decoration will be applied to the text within the affected tag. The valid values for this property are underline, overline, line-through, and blink. The application of each of them is self-explanatory. However, here's an example that demonstrates how to use each of them:


Font Properties:
When you want to modify the appearance of text, the other major family of properties you can use is font properties. Font properties can be used to modify pretty much any aspect of the type used to render text in a browser. One of the particularly nice things about font properties is that they're much more specific than the tags that you've seen so far.

The font-style property can be used to italicize text. It has three possible values, normal, which is the default, italic, which renders the text in the same way as the <i> tag, and oblique, which is somewhere between italic and normal, and is not as well supported by browsers as the italic style is. Here are some examples:



Formatting Text's lessons:

Character-Level Elements
Formatting Using CSS
Preformatted Text
Horizontal Rules
Line Break
Addresses
Quotations
Text Alignment
Fonts And Its Attributes
Special Characters

Banner HomeServices Contact |  ©2009 http://www.iteachweb.net/