Jump to content

How do I control List Item indentation


javajoemorgan

Recommended Posts

I have a simple CSS entry:li { margin-left: 0px; padding-left: 0px }However, my list items still indent. I have both margin and padding because any individual one didn't work.Indents in both FF and IE.... How do I get rid of it? Well, I really want to shrink it... that's how I ended up at 0... because I couldn't tell a difference at 5.

Link to comment
Share on other sites

what is the margin/padding of the UL set to?Please post a link to the page. Thanks.
You can't reach this page, and it is huge... however, I've done nothing to the UL. Do I also need to link up the UL and LI margins/padding? As in:
ul { margin-left: 0px; padding-left: 0px; }li { margin-left: 0px; padding-left: 0px; }

Link to comment
Share on other sites

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>	<title>Test UL/LI margins and padding</title>	<meta http-equiv="content-type"  content="text/html;charset=utf-8" />	<meta http-equiv="Content-Style-Type" content="text/css" /><style type="text/css" >	#test ul { margin: 0; padding:0; } #test1 li { margin: 0; padding:0; }#test2 ul li { margin: 0; padding:0; } </style></head><body><div>	<h3>Default margins and padding</h3><ul>	<li>Sample Text <em>and more...</em></li>	<li><em>Sample Text</em> and more...</li>	<li>Sample Text and more...</li></ul></div><div  id="test" >	<h3>Zero margins and padding on the UL</h3><ul >	<li>Sample Text <em>and more...</em></li>	<li><em>Sample Text</em> and more...</li>	<li>Sample Text and more...</li></ul></div><div id="test1" >	<h3>Zero margins and padding on the LI</h3><ul >	<li >Sample Text <em>and more...</em></li>	<li><em>Sample Text</em> and more...</li>	<li>Sample Text and more...</li></ul>	</div><div id="test2" >	<h3>Zero margins and padding on both</h3><ul >	<li >Sample Text <em>and more...</em></li>	<li><em>Sample Text</em> and more...</li>	<li>Sample Text and more...</li></ul>	</div></body></html>

Check that out.

Link to comment
Share on other sites

...[b][/b]<style type="text/css" >	#test ul { margin: 0; padding:0; } #test1 li { margin: 0; padding:0; }#test2 ul li { margin: 0; padding:0; } </style>...

Check that out.

Perfect! But, it leaves me confused. This certainly makes it appear that UL and LI have margins, and thus both needed to be 0. However, any changes I made to LI seemed to not take affect until after I set the UL margin to 0. What am I missing here?
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...