Solved

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

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

708 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

19 Experts available now in Live!

Get 1:1 Help Now