Using CSS

Inline Styles

Inline styles sit within the body of the html document, normally as a style attribute of the HTML element it refers to.

For example, this code absolutely styles a div. In Dreamweaver, divs styled this way are called layers.

<div id="Layer1" style="position:absolute; width:200px; height:115px; z-index:1;"></div>

Advantages of inline styles are

  • it's easy to modify a style later, because it's contained in the HTML of the object you want to modify.

Disadvantages of inline styles are

  • the HTML code gets very cluttered with styles so it difficult to read
  • the file size of all the additional code can add up, leading to longer download times
  • it's difficult to modify lots of inline styles because there are so many, they all must be individually modified