Quackit Logo
HTML
CSS
Scripting
Database
Hosting
Design
XML

Inline Style Sheets

Inline style sheets is a term that refers to style sheet information being applied to the current element. By this, I mean that instead of defining the style once, then applying the style against all instances of an element (say the <p> tag), you only apply the style to the instance you want the style to apply to. Actually, it's not really a style sheet as such, so a more accurate term would be inline styles.

Syntax

In the code below, we've added CSS by using inline styles. You can tell because we've added the styles to the <p> tag using the style attribute.

Code

Example

Modify the code below, then click "Update". See below for attributes.

Source CodeResult

Using inline styles is not as powerful as embedded style sheets, imported style sheets, or linking to an external style sheet. To specify style information for more than one element, you should embed a style sheet in the header of the HTML document. Better yet, you should define styles in an external style sheet, then link to that style sheet. You then can apply the style across mulitple HTML documents.

Enjoy this page?

  1. Link to this page (copy/paste into your own website or blog):
  2. Link to Quackit using one of these banner ads.

Thanks for supporting Quackit!

Sponsored Link: Design CODE-FREE Websites