Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jun 2007
    Posts
    57
    Thanks
    4
    Thanked 1 Time in 1 Post

    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

  • #2
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    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.

  • #3
    New Coder
    Join Date
    Jun 2007
    Posts
    57
    Thanks
    4
    Thanked 1 Time in 1 Post
    well i want padding for above the link and i dont want padding above h3

  • #4
    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
    Well it's top, right, bottom, left so it is correct.
    .
    .

  • #5
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •