faqts : Computers : Internet : Web : CSS

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

12 of 12 people (100%) answered Yes
Recently 8 of 8 people (100%) answered Yes

Entry

How can I add a margin to <li> with Netscape while keeping the bullet?

May 9th, 2000 22:08
Rey Nuņez, Dominik Rabiej,


In IE4/5,NN4/6, you would normally add margins to the UL element 
instead. For example, in either an embedded or linked style sheet, you 
can declare:
ul, ol {
  margin-left:30; margin-right:30;
  padding:10
}
This would render unordered (UL) and ordered (OL) lists with the 
specified margins. The padding attribute can be used to set how much 
space to insert between the list's border edge and its content.
You can also specify paddings for the list items (LI) themselves, which 
would set the space to insert between the list items:
li {
  padding:2
}
For nested lists, you can also, for example, declare:
ul ul, ol ul {
  margin-left:5; margin-right:5; padding:0;
  list-style-type:square
}
which would set the margins, paddings, and the list style marker for 
the next nested list (another list within the list).
Margin and padding length units default to pixels (px) if none is 
specified. For more information on CSS measurement units, please see:
http://www.faqts.com/knowledge-base/view.phtml/aid/2390/fid/337/lang/