Solved

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

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Jquery/JSON passing value from one function to another 12 40
Bottom border change 5 15
css selector 1 17
Little bit of help styling my heading 3 21
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

803 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