Programmer's Corner Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Programmer's Corner - Forums


Problem with lists.

 
Post new topic   Reply to topic    Programmer's Corner Forum Index -> HTML, CSS, VBScript, JavaScript
Author Message
blcArmadillo
Samurai++


Joined: 04 Mar 2005
Posts: 85
Location: Michigan

PostPosted: Wed Mar 28, 2007 7:50 pm    Post subject: Problem with lists. Reply with quote

I'm using lists right now to create a navagation menu. Everything seems to be working fine, however, I can't get rid of some space between the "buttons" which are images.

Here is an image of the problem:


Here is my CSS code for the nav:
Code:
/* Layout---------------------------------------- */
...
#navpholder {
   float:left;
   width:152px;
}
...

/* Nav---------------------------------------- */
#nav, #nav ul {
   list-style:none;
   padding:0px;
   margin:0px;   
}
#nav li ul {
   display:none;
}
#nav li:hover ul {
   display:block;
}


Here is my HTML for the nav:
Code:
...
<div> // should have an id attribute called navpholder, but the the forum seems to be editting it out.
   <ul> // should have an id attribute called nav, but the forum seems to be editting it out.
      <li><img src="images/navparent.gif"></li>
      <li><img src="images/navparent.gif">
         <ul>
            <li><img src="images/navchildf.gif"></li>
            <li><img src="images/navchild.gif"></li>
         </ul>
      </li>
      <li><img src="images/navparent.gif"></li>


   </ul>
</div>
...


Does anyone have any suggestions of how I can eliminate this white space? If you have any questions regarding my question please ask. Thanks. -Ian
Back to top
Ankou
Spam Mod


Joined: 22 Oct 2004
Posts: 1201
Location: Wisconsin

PostPosted: Thu Mar 29, 2007 7:28 am    Post subject: Reply with quote

Set margin and padding to 0 for both ul and li....

ul{ margin: 0; padding: 0; }
li{ margin: 0; padding: 0; }

If you need some padding on a particular list/list item then add it using the id.

Also you set #nav ul with margin and padding to be 0 but your ul tag doesn't use the id "nav". Make sure that you watch out for things like that. Smile
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Programmer's Corner Forum Index -> HTML, CSS, VBScript, JavaScript All times are GMT - 5 Hours
Page 1 of 1

 


Powered by phpBB © 2001, 2002 phpBB Group