Solved

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

Posted on 2008-10-31
2
694 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

809 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