...

View Full Version : trouble with padding



raptrex
08-04-2007, 04:10 PM
i have a list that i want padded but it also adds padding above my h3

heres my html

<div id="primary" class="sidebar">
<li id="pages" class="box">
<h3>Pages</h3>

<ul>
<li class="page_item"><a href="http://localhost/wordpress/index.php/about/" title="About">About</a></li>
<li class="page_item"><a href="http://localhost/wordpress/index.php/test/" title="test">test</a></li>
</ul>
</li>
</div>

and my css

div.sidebar div,div.sidebar h3,div.sidebar ul,div.sidebar li{margin:0;padding:0;}
div.sidebarinner{width:150px}
div.sidebar h3{font-size:1.2em;background-color:#2d2d2d;text-align:center;padding:3px 0 3px 0;}
div.sidebar input#s{width:7em;}
div.sidebar li{list-style:none;margin:0 0 1em;background-color:#404040;padding:5px 0 5px 0;}
div.sidebar li form{margin:0.2em 0 0;padding:0;}
div.sidebar ul ul{margin:0 0 0 1em;}
div.sidebar ul ul li{list-style: none;margin:0;}
div.sidebar ul ul ul{margin:0 0 0 0.5em;}
div.sidebar ul ul ul li{list-style-type: disc;}
div.sidebar .box{border:1px solid #202020;}

i would like to get rid of the padding above the h3

BWiz
08-04-2007, 04:54 PM
div.sidebar h3{font-size:1.2em;background-color:#2d2d2d;text-align:center;padding:3px 0 3px 0;}

Red: Try replacing it with 0

EDIT: Nvm: remembered that thats for left padding.

raptrex
08-04-2007, 05:28 PM
well i want padding for above the link and i dont want padding above h3

Jutlander
08-04-2007, 05:29 PM
Well it's top, right, bottom, left so it is correct.

koyama
08-05-2007, 12:29 AM
heres my html

<div id="primary" class="sidebar">
<li id="pages" class="box">
<h3>Pages</h3>

<ul>
<li class="page_item"><a href="http://localhost/wordpress/index.php/about/" title="About">About</a></li>
<li class="page_item"><a href="http://localhost/wordpress/index.php/test/" title="test">test</a></li>
</ul>
</li>
</div>

I'm not sure what the problem is, but your HTML is invalid. The <li>...</li> element can never be nested directly within a <div>...</div> element. This could be the cause of the problem. You need to fix that first.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum