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

Indenting Lists

By , About.com Guide

1 of 3

Indenting Lists Looks Different In Different Browsers

A Typical HTML List

A Typical HTML List

Screen shot by J Kyrnin

When you write a plain HTML list like this:

<ul>
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
</ul>

Web browsers display the list with some indenting on the left side. As you can see from the image on this page, the unordered list is indented slightly from the left margin of the div it is in (the black border).

In order to do this, the browser makers had three ways they could implement it:

  • Give each LI element a left margin.
  • Give each UL or OL element a left margin.
  • Give each UL or OL element a left padding.

So far, no browsers have used the first option. Internet Explorer and Opera add left margins and Firefox and Safari add left paddings.

Explore Web Design / HTML
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. CSS
  5. Indenting Lists - Getting Your Lists Lined Up in Different Browsers>

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

All rights reserved.