Solved

Why does my pulldown disappear?

Posted on 2013-06-27
5
264 Views
Last Modified: 2013-06-27
I've got a pulldown menu that I'm attempting that you can see at http://www.hihatwebdesign.com/Trinity/header.php

The problem is that the pulldown disappears so you can never mouse over it. From what I can gather, the problem may be a z-index setting?

In any event, my stylesheet is below. Where am I blowing it?

body {
	font-family: Helvetica, Microsoft Sans Serif;
	font-size: 14px;
	color: #000000;
	vertical-align: top;
	padding: 0px;
	height: 100%;
	width: 100%;
	margin: 0;
	background-color:#202740;
}

#body_tray {
position:relative;
width:997px;
height:800px;
margin:auto;
padding:25px;
}

#header {
position:relative;
margin:auto;
height:236px;
width:997px;
background-image:url(images/header.png);
background-repeat:none;
z-index:-1;
}

#search_box {
position:relative;
z-index:2;
margin-left:820px;
margin-top:175px;
}

#nav_bar {
position:relative;
margin:auto;
width:997px;
height:38px;
background-image:url(images/nav_bar.png);
background-repeat:no-repeat;
}

#navcontainer ul {
margin-top: 5px;
padding: 0;
list-style-type: none;
}

#navcontainer ul ul {
display: none;
margin-left: 0;
padding: 0;
width: 200px;
position: absolute;
top: 33px;
background: #ffffff;
z-index:10;
border-style:solid;
border-width: thin;
border-color:#cccccc;
}

#navcontainer ul li:hover > ul 
{
display: block;
}

#navcontainer ul li { 
display: block;
float:left; 
}

#navcontainer ul li a
{
font-family: Arial Narrow, Microsoft Sans Serif, Helvetica;
font-size: 18px;
color:#493417;
font-weight:bold;
text-decoration: none;
padding-left:45px;
padding-right:40px;
display:block;
}

#navcontainer ul li a:hover
{
color: #4b7235;
}

#navcontainer ul ul li a {
font-family: Arial Narrow, Microsoft Sans Serif, Helvetica;
font-size: 16px;
color:#493417;
padding-left:5px;
}

#navcontainter:after {
	content: ".";
	display: block;
	clear: both;
	visibility: hidden;
	line-height: 0;
	height: 0;
}



#body_block {
position:relative;
width:997px;
height:485px;
background-image:url(images/body_block.png);
background-repeat:none;
z-index:-2;
}

#body_text {
position:absolute;
width:704px;
height:482px;
margin-left:267px;
margin-top:5px;
background-color:#cccccc;
}

#left_column {
position:absolute;
width:230px;
height:503px;
margin-left:25px;
margin-top:5px;
}

#cursor {
position:absolute;
width:13px;
height:25px;
background-image:url(images/cursor.png);
background-repeat:none;
margin-top:150px;
margin-left:125px;
z-index:2;
}

#left_nav {
display:inline-block;
position:absolute;
width:230px;
height:329px;
margin-left:25px;
margin-top:180px;
background-image:url(images/left_column_background.png);
background-repeat:none;
}


#footer {
position:relative;
height:26px;
width:997px;
margin:auto;
}

input.login_box{
   border:0px;
  width:109px;
  height:21px;
  font-size: 10px;
  color: #cccccc;
  display: inline;
}

a.staff {
margin-top:0px;
display:inline-block; /**** important ****/
width:230px;
height:43px;
background-image:url(images/link_church_light.png);
background-repeat:no-repeat;
}

a.staff:hover {
margin-top:0px;
display:inline-block; /**** important ****/
width:230px;
height:43px;
background-image:url(images/link_church_dark.png);
background-repeat:no-repeat;
}

a.directions {
margin-top:1px;
display:inline-block; /**** important ****/
width:230px;
height:43px;
background-image:url(images/link_directions_light.png);
background-repeat:no-repeat;
}

a.directions:hover {
margin-top:1px;
display:inline-block; /**** important ****/
width:230px;
height:43px;
background-image:url(images/link_directions_dark.png);
background-repeat:no-repeat;
}

a.times {
margin-top:1px;
display:inline-block; /**** important ****/
width:230px;
height:43px;
background-image:url(images/link_times_light.png);
background-repeat:no-repeat;
}

a.times:hover {
margin-top:1px;
display:inline-block; /**** important ****/
width:230px;
height:43px;
background-image:url(images/link_times_dark.png);
background-repeat:no-repeat;
}

a.directory {
margin-top:1px;
display:inline-block; /**** important ****/
width:230px;
height:43px;
background-image:url(images/link_directory_light.png);
background-repeat:no-repeat;
}

a.directory:hover {
margin-top:1px;
display:inline-block; /**** important ****/
width:230px;
height:43px;
background-image:url(images/link_directory_dark.png);
background-repeat:no-repeat;
}

a.gallery {
margin-top:1px;
display:inline-block; /**** important ****/
width:230px;
height:43px;
background-image:url(images/link_gallery_light.png);
background-repeat:no-repeat;
}

a.gallery:hover {
margin-top:1px;
display:inline-block; /**** important ****/
width:230px;
height:43px;
background-image:url(images/link_gallery_dark.png);
background-repeat:no-repeat;
}

a.pastor {
margin-top:1px;
display:inline-block; /**** important ****/
width:230px;
height:43px;
background-image:url(images/link_pastor_light.png);
background-repeat:no-repeat;
}

a.pastor:hover {
margin-top:1px;
display:inline-block; /**** important ****/
width:230px;
height:43px;
background-image:url(images/link_pastor_dark.png);
background-repeat:no-repeat;
}

a.gallery {
margin-top:1px;
display:inline-block; /**** important ****/
width:230px;
height:43px;
background-image:url(images/link_gallery_light.png);
background-repeat:no-repeat;
}

a.gallery:hover {
margin-top:1px;
display:inline-block; /**** important ****/
width:230px;
height:43px;
background-image:url(images/link_gallery_dark.png);
background-repeat:no-repeat;
}


a.campus {
margin-top:1px;
display:inline-block; /**** important ****/
width:230px;
height:43px;
background-image:url(images/link_campus_light.png);
background-repeat:no-repeat;
}

a.campus:hover {
margin-top:1px;
display:inline-block; /**** important ****/
width:230px;
height:43px;
background-image:url(images/link_campus_dark.png);
background-repeat:no-repeat;
}

Open in new window

0
Comment
Question by:brucegust
5 Comments
 
LVL 42

Accepted Solution

by:
Chris Stanyon earned 200 total points
Comment Utility
The height of your nav_bar is 38px and the height of your nav items is 21px so there is a gap between the bottom of your nav items and the top of your pull down of about 17px. As soon as your mouse enters this gap, you are no longer hovering over the nav item so the drop down disappears.

Set the height of your nav items to the same as your nav_bar and you should be good to go. The easiest way to do this is to set a height for the A tags using either line-height:38px or height:38px (aboutl ine 84 of stylesheet.css). You may also need to tweak some other elements:

#navcontainer ul li a {
     line-height: 38px;
     ...
}

Open in new window

0
 
LVL 6

Assisted Solution

by:lightspeedvt
lightspeedvt earned 150 total points
Comment Utility
I am agree with ChrisStanyon, but would add the  identifier as to avoid implementing those styles to the left navigation box and use "line-height:32px" for <a> and correct to the "top:27px" for <ul>. So, final CSS that should be added (for example to the line #117 in your CSS file or to the end of it) will be:
#nav_bar #navcontainer ul ul {
	top: 27px;
}
#nav_bar #navcontainer ul li a {
	line-height: 32px;
}

Open in new window

0
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 150 total points
Comment Utility
Hey @brucegust, I was just answering your question about the gap and it was deleted as I clicked the submit button.

You may have fixed one issue but after going through your page, there are a lot of errors on the page.  You had a form start inside of a table but closed after the table tag closed, there are open tags, using absolute positioning instead of relative.  The page does not validate.  I would suggest putting your url into the bugfinder.  It's a new service here and the link is in the upper left corner in white letters.  This will allow multiple experts to look over your site and nit pick at all these things.   It will help you greatly in the end.
0
 

Author Comment

by:brucegust
Comment Utility
Hey, guys!

As always, I appreciate your time and I value your input.

I've been able to get my page repaired, but I've got one more problem and I'll invite you to weight on that by heading out to http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/CSS/Q_28170219.html

padas, I took your counsel and attempted to clean up my page and I'm pretty much there as far as eliminating those places where I needed to be formatting things using CSS as opposed to antiquated elements.

What remains is questionable only because I have no idea what it is that they're defining as a problem. I'm referring to things such as:

Line 65, Column 61: Unclosed element form.
<td><form action="search.php" method="Post" class="search">

That looks closed to me and I don't know how to fix it so it's up to snuff. If you want to point me in the right direction there, that would be appreciated. In the interim, let me distribute some points.

Thanks!
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
Line 65, Column 61: Unclosed element form.
<td><form action="search.php" method="Post" class="search">


When you are coding, everything must be closed in the same order it was opened. It helps if you indent your code so you can easily see what level you are on.
Here the form is inside of a td tag (table cell)
<table>
  <tr>
      <td>
            <form>
            </form>
       </td>
   </tr>
</table>

Open in new window

You have this
<table class="form">
<tr>
<td><form action="search.php" method="Post" class="search">
<input type="text" name="search" class="login_box"></td><td class="form">
<input type="image" src="images/search_icon.jpg" name="submit" alt="submit"></form>
</td>
</tr>
</table>

Open in new window

If I indent, it looks like this and you can now see the issue. If you are going to make a form span across multiple td's, you should open and close your form outside the td's or tr's.
<table class="form">
     <tr>
          <td>
               <form action="search.php" method="Post" class="search">
                    <input type="text" name="search" class="login_box">
          </td>
          <td class="form">
               <input type="image" src="images/search_icon.jpg" name="submit" alt="submit"> 
          </form>
          </td>
     </tr>
</table>

Open in new window

This is the correct way
<table class="form">
     <form action="search.php" method="Post" class="search">
     <tr>
          <td>
               <input type="text" name="search" class="login_box">
          </td>
          <td class="form">
               <input type="image" src="images/search_icon.jpg" name="submit" alt="submit"> 
          </td>
     </tr>
     </form>
</table>

Open in new window

0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
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 …

743 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

15 Experts available now in Live!

Get 1:1 Help Now