Solved

Why does my pulldown disappear?

Posted on 2013-06-27
5
265 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 43

Accepted Solution

by:
Chris Stanyon earned 200 total points
ID: 39282368
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
ID: 39282683
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
ID: 39282985
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
ID: 39283363
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
ID: 39283514
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
text align center the options is an html select 4 39
Applying an inline style that applies to child elements 2 36
Error on Add method 1 38
CSS Logo Problem. 2 8
This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

895 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

12 Experts available now in Live!

Get 1:1 Help Now