AlfieWebDevTips Homefor new and experienced developers
[Home Home] [Web Development Web Development ] [Code Generators Code Generators ] [Resources Resources ] [Contact Us Contact ] |WebDevTips Privacy Privacy |
Print This Page

You are here : Home - Web Development - Style Sheets - Guide - Inline Styles

Inline Style Sheets



Style sheets can be used to reformat current html tags. All the text formatting tags such as <p> <b> etc can have a style applied rewriting the default setting for each.

I will explain later the most common properties that you can change with style sheets but for now we'll just look at applying the styles.

There are a few ways of applying style sheets and I'll explain the pros and cons of each.

Inline Style

Example
this is a <b> tag with no style applied
this is the <b> tag with style applied

We could have used the font tag but support for the font tag is being depreciated in favor of style sheets.

The above example was created using an inline style which means we create the style when we create the tag.

Inline styles follow the format <[tagname] style="[properties]">

In the example above I used an inline style
<b style="color:red; text-decoration:underline;">

Inline styles are fine for creating a 1 off style but aren't much use if, for example you wanted all your <b> tags to have that style. You would have to change every <b> tag, basically leaving us with the same problem we had if we were using font tags.

So what we'll look at next is using embedded style sheets



Why not discuss this article in our forum?






Google
 

[back to top of page]   

[labelled with icra -  - this link will open in a new window] [RSS Content]

[Copyright © WebDevTips]