Solved

How do I remove the vertical space from lists using CSS?

Posted on 2008-10-31
2
689 Views
Last Modified: 2012-05-05
I've created a drop down menu from a template using CSS. I've gotten it almost perfect but am having trouble getting rid of the vertical space between my images. I would like the images in the list to line up flush with each other, not displaying the blue outline of the box behind them. Here is a page with the menu I have on the right and a jpg of what I want it to look like on the left.

http://www.glowfishtw.com/flagfootball/menu.asp

I've attached the style sheet I'm using and here is the code for my page. Thanks for any help.

<!-- Begin Grab This - You'll need this external CSS file and the IE Statement below -->
<style type="text/css">@import url("menuh.css");</style>
<!--[if lt IE 7]>
<style type="text/css" media="screen">
#menuh{float:none;}
body{behavior:url(csshover.htc); font-size:100%;}
#menuh ul li{float:left; width: 100%;}
#menuh a{height:0%;font:bold 0.7em/1.4em arial, sans-serif;}
</style>
<![endif]-->
<!-- End Grab This -->

</head>

<body>

                <table width="667" border="1">
              <tr>
                <td><img src="images/example.jpg"></td>
                <td>
                        
<!-- Begin CSS Horizontal Popout Menu -->                        
                  <div id="menuh">
                        <ul>
                          <li><a href="#" class="top_parent"><img src="images/register.jpg" border='0'></a>
                              <ul>
                                    <li><a href="#"><img src="images/winter.jpg" border='0'></a></li>
                                    <li><a href="#"><img src="images/spring.jpg" border='0'></a></li>
                                    <li><a href="#"><img src="images/fall.jpg" border='0'></a></li>
                                    <li><a href="#"><img src="images/summer.jpg" border='0'></a></li>
                              </ul>
                          </li>
                        </ul>
                  </div>
<!-- End CSS Horizontal Popout Menu -->      
                  
      </td>
                <td>&nbsp;</td>
              </tr>
            </table>
               
#menuh

	{

	font-size: small;

	font-family: arial, helvetica, sans-serif;

	width:100%;

	float:left;

	background-image: none;

	margin: 0px;

	}

		

#menuh a

	{

	text-align: center;

	display:block;

	border:0px;

	white-space:nowrap;

	margin:0;

	padding:0px;

	}

	

#menuh a:link, #menuh a:visited, #menuh a:active	/* menu at rest */

	{

	color: white;

	text-decoration:none;

	background-image: none;

	background-repeat: no-repeat;

	background-color: #0105A7;

	}

	

#menuh a:hover	/* menu at mouse-over  */

	{

	color: white;

	background-color: #0105A7;

	text-decoration:none;

	}	

	
 

#menuh ul

	{

	list-style:none;

	margin:0;

	padding:0;

	float:left;

	width:84px;     /* width of all menu boxes */

	height:10px;	/* This is where I was trying to change it but no luck */

	}
 

#menuh li

	{

	position:relative;

	min-height: 1px; 			/* Sophie Dennis contribution for IE7 */

	vertical-align: bottom; /* Sophie Dennis contribution for IE7 */

	background-image: none;

	}
 

#menuh ul ul

	{

	position:absolute;

	z-index:500;

	top:auto;

	display:none;

	padding: 1em;

	margin:-1em 0 0 -1em;

	}
 

#menuh ul ul ul

	{

	top:0;

	left:100%;

	}
 

div#menuh li:hover

	{

	cursor:pointer;

	z-index:100;

	}
 

div#menuh li:hover ul ul,

div#menuh li li:hover ul ul,

div#menuh li li li:hover ul ul,

div#menuh li li li li:hover ul ul

{display:none;}
 

div#menuh li:hover ul,

div#menuh li li:hover ul,

div#menuh li li li:hover ul,

div#menuh li li li li:hover ul

{display:block;}
 

/* End CSS Drop Down Menu */

Open in new window

0
Comment
Question by:elliottbenzle
2 Comments
 
LVL 44

Accepted Solution

by:
scrathcyboy earned 500 total points
ID: 22855736
UL, LI  {margin:0px; padding:0px; }
IMG  { margin:0px; padding:0px; border:0px }

do the same for DIV if that is causing some of it.
0
 
LVL 6

Expert Comment

by:lpxtech
ID: 22855931
Also, If you would like to get rid of the blue outlines, removing the background: #0105A7; on the a tags should work.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now