Solved

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

Posted on 2008-10-31
2
696 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Do I need to force my browser to see my new Favicon 4 50
boostsrap 1 35
Execute jQuery after Function 4 40
emailing registered email addresses in phpmyadmin 5 68
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
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 …
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…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

739 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