Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-04-2007, 04:10 PM   PM User | #1
raptrex
New Coder

 
Join Date: Jun 2007
Posts: 57
Thanks: 4
Thanked 1 Time in 1 Post
raptrex is an unknown quantity at this point
trouble with padding

i have a list that i want padded but it also adds padding above my h3

heres my html
Code:
<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
Code:
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
raptrex is offline   Reply With Quote
Old 08-04-2007, 04:54 PM   PM User | #2
BWiz
Regular Coder

 
BWiz's Avatar
 
Join Date: Mar 2006
Location: Sol System
Posts: 471
Thanks: 7
Thanked 21 Times in 21 Posts
BWiz is an unknown quantity at this point
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.
__________________
BWiz :: Happy Coding!
2006
2007 2008 2009
2010 2011
Irrational numbers make no sense.
BWiz is offline   Reply With Quote
Old 08-04-2007, 05:28 PM   PM User | #3
raptrex
New Coder

 
Join Date: Jun 2007
Posts: 57
Thanks: 4
Thanked 1 Time in 1 Post
raptrex is an unknown quantity at this point
well i want padding for above the link and i dont want padding above h3
raptrex is offline   Reply With Quote
Old 08-04-2007, 05:29 PM   PM User | #4
Jutlander
Regular Coder

 
Jutlander's Avatar
 
Join Date: Jun 2007
Location: In my own sick little world :P
Posts: 425
Thanks: 1
Thanked 12 Times in 12 Posts
Jutlander is on a distinguished road
Well it's top, right, bottom, left so it is correct.
__________________
.
.
Jutlander is offline   Reply With Quote
Old 08-05-2007, 12:29 AM   PM User | #5
koyama
Senior Coder

 
koyama's Avatar
 
Join Date: Dec 2006
Location: Copenhagen, Denmark
Posts: 1,246
Thanks: 1
Thanked 5 Times in 5 Posts
koyama will become famous soon enough
Quote:
Originally Posted by raptrex View Post
heres my html
Code:
<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.
koyama is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:48 AM.


Advertisement
Log in to turn off these ads.