Web Design / HTML

  1. Home
  2. Computing & Technology
  3. Web Design / HTML

Types of CSS Styles

Inline, Embedded, and External Style Sheets

By Jennifer Kyrnin, About.com

There are three types of CSS styles:

  • inline styles
    Inline styles are styles that are written directly in the tag on the document. Inline styles affect only the tag they are applied to.
    <a href="" style="text-decoration: none;">
  • embedded styles
    Embedded styles are styles that are embedded in the head of the document. Embedded styles affect only the tags on the page they are embedded in.
    <style type="text/css">
    p { color: #00f; }
    </style>
  • external styles
    External styles are styles that are written in a separate document and then attached to various Web documents. External style sheets can affect any document they are attached to.
    <link rel="stylesheet" type="text/css" href="styles.css" />

CSS best practices recommends that you use primarily external style sheets for styling Web pages so that you get the most benefit of the cascade and inheritance.

Explore Web Design / HTML

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Web Design / HTML

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. CSS
  5. Types of CSS Styles - Inline, Embedded, and External Style Sheets

©2009 About.com, a part of The New York Times Company.

All rights reserved.