473,386 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Drop Down Navigation Menu Not Lining Up...

58
Hey everyone-

This is my first post at The Scripts, but I've used the forums before for other programming issues. Hopefully, someone has some solid styling advice for me.

I've now been dealing with XHTML/CSS for about a week. I'm trying to set up a website for my dad, and this navigation menu is driving me nuts.

I designed this part of the site on Firefox 2.0.

Here's the link: http://www.yalestartups.com/tburger/test.html

If you open it in Firefox, the navigation works as designed. Drop-down boxes appear under each link, and the link changes color upon mouse-over.

The problem occurs when I open the page in other browsers. Even though I've put the navigation menu on a separate z-index and positioned it absolutely, I want it to line up the way it does in Firefox.

I assume this is a cross browser issue - and I've tried to globally change the margins and padding to accommodate this...

But I think it may be something else, because the :hover behaviors don't act the same in other browsers either.

This could be blatantly obvious, but I'm new...

Any help, comments, advice would be appreciated...I've really enjoyed working on this first site, and would like to get more seriously involved with web design...

Thanks,

Tom

------------CSS File

/* Universal Browser Accomodation */

* {
padding:0;
margin:0;
}



/* Body: Format Color / Margins */

body{
margin: 0;
padding: 0;
background: #333333;
}

/*-------Central Content Box id = "container"-------*/

#container{
width: 850px;
height: auto;
position: absolute;
top:0;
left:50%;
margin-left: -425px;
background: white;
border-left: solid 1px black;
border-right: solid 1px black;
border-bottom: solid 2px black;
z-index:1;

}

/*---------Primary Text Box id = "textbox"---------*/

#textbox{
width: 640px;
height: auto;
padding-left: 200px;
padding-top: 0px;
}

/* Content Styling */

h1{
font-family: Geneva;
font-size: 24px;
color: #0066CC;
border-bottom: solid 2px #cc9900;
}

p{

font-family: geneva;
font-size: 16px;
}

/*-------Page Background Structure----------*/

/* Background Table */

table{
width: 850px;
height: 259px;
border-bottom: solid 1px black;
}

/* Table Column Definitions */
td.left{
width: 339px;
}

td.right{
width: 511px;
}
#navleft{
margin:0;
height:133px;
background-image:url(topleft.gif);
}

#navbleft{
margin:0;
height:125px;
background-image:url(botleft.gif);
}

#navright{
margin:0;
height: 133px;
background-image: url(topright.gif);
}
#navbright{
margin:0;
height: 125px;
background-image: url(botright.gif);
}

/*------Top Navigation Menu------------*/

dt{
min-height:30px;
}
#dropmenu{
position: absolute;
top: 37px;
left: 474px;
z-index:3;
}
#dropmenu dl{
float: left;
}

#dropmenu dt{
cursor: pointer;
}

#dropmenu dd{
float: left;
text-align: left;
margin-top: -4px; /*IMPORTANT Overlap with "dt" for Clean Navigation*/
margin-left: 10px;
width: 125px;
background-color: #999999;
border: solid 1px black;
}

#dropmenu a.slink{
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
text-decoration: none;
color: white;
}

#dropmenu li{
text-align: left;
height:auto;
display: block;
width:auto;
margin-left: 5px;
margin-top: 2px;
margin-bottom: 4px;
}

#dropmenu a.slink:hover{
color: #660000;
}

#dropmenu li:hover{
border-bottom: dotted 3px #CC9900;
}


/* Secondary (Lower) Link Positioning */
#lownav{
position: absolute;
top: 75px;
left: 765px;
z-index: 2;
}

/* Top Link Styling */
a.nav, a.lownav{
margin-left: 14px;
color: white;
font-family:Geneva, Arial, Helvetica, sans-serif;
font-size: 14px;
text-decoration: none;
}

a.lownav{
margin-left: 10px;
}


/* Top Link Hover Actions*/
a.nav:hover,a.lownav:hover{
color:#CC9900;
}

/*------Side Navigation Box------------------*/

#snav{
margin-top: 0px;
margin-bottom: 0px;
float: left;
width: 185px;
min-height: 500px;
background-color: #5A594A;
border-right: solid 1px black;
clear: left;
}

/* Side Link Styling*/

/* One Line Link Definitions */
a.snavone{
margin-top: 12px;
float: left;
width: 173px;
height: 30px;
background-color: #003366;
border-top: solid 2px black;
border-right: solid 2px black;
border-bottom: solid 2px black;
text-decoration: none;
}

/* Two Line Link Definitions */
a.snavtwo{
margin-top: 12px;
float: left;
width: 173px;
height: 47px;
background-color: #003366;
border-top: solid 2px black;
border-right: solid 2px black;
border-bottom: solid 2px black;
text-decoration: none;
}

/* Side Link Spacing */
span.snavtext{
padding-top: 5px;
padding-left: 12px;
display: block;
text-align: left;
color: white;
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 14px;
}

/* Side Link Hover Action */
a.snavone:hover, a.snavtwo:hover{
background-color:#660000;
}


/* -------Page Footer-------*/
#footer{
margin: 0;
float: left;
clear: left;
width: 850px;
height: 24px;
background-image: url(foot.gif);
background-repeat: repeat-x;
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
border-top: solid 1px black;
}

/* Footer Text Styling */
#footttext{
display: block;
text-align:center;
margin-top: 6px;
color: white;
}

/* Footer Dividers */
span.yell{
color: #CC9900;
}
Jul 13 '07 #1
4 3970
drhowarddrfine
7,435 Expert 4TB
In your doctype:
<!DOCTYPE html PUBLIC ?-//W3C//DTD XHTML

The question mark should be a quote ".

This puts IE into quirks mode and it won't attempt to work like modern browsers. Maybe not the real issue but try it.
Jul 13 '07 #2
tburger
58
Thanks...I tried this, but I think it has something to do with the positioning ultimately...I don't understand why some elements seem unaffected while others, like the navigation menu and text area, look great in Firefox, but horrible in other browsers...
Jul 13 '07 #3
tburger
58
I figured out what was wrong:

I had been positioning the div box containing the navigation menu absolutely from the top left of the PAGE. Since the distance from my main container div varies in different browsers, this was throwing off the alignment. What I needed to do was position the navigation menu absolutely from the top left of the CONTAINER DIV. Once I did this, the navigation seemed to work properly...

Does anyone know how Safari handles ":hover" behaviors? The proper mouse-over effect occures in Firefox and Camino, but not in Safari? Any advice?
Jul 14 '07 #4
drhowarddrfine
7,435 Expert 4TB
hover works fine in Safari. Must be something else.
Since the distance from my main container div varies in different browsers
Don't know why that would be since you set margins to zero.
Jul 14 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Yve | last post by:
Hello, I am new here and received good advice many times before by just reading - now I would like to ask this question: I have got a frameset of 5 frames: navigation and 4 content-frames. How...
3
by: KK | last post by:
Drop-down menus are the hottest thing since Wonder Bread but . . . 1. Alot of people put them in the they-look-nice-but-you-cant-code-them-right-so-they-always-look-messed-up category (a la...
8
by: Yeah | last post by:
I wish to use a drop box where each Option will not take the user to a web page - but a certain location on the same page the drop box exists. For example, Option 1 would take the user to "Chapter...
1
by: ngoc | last post by:
Hi I want to build dropdown navigation menu. Searching from google gives many commercial programs -> Not easy to choose. And I want to make it myself. Are there any good tutorials to build...
3
by: Andrew | last post by:
Hello, friends, I was asked to implement a .aspx page with drop down menus. When a mouse pointer moves over a menu bar, a drop down list containing sub-menus will show up. Thus a user may select...
3
by: lewisthesmith | last post by:
I'm not really sure if this is a CSS issue, but people here before have been knowledgeable and friendly and so it seems like a good place to start. I'm in the process of building a new site for...
2
by: Steve Richter | last post by:
I would like to have a standard site navigation menu, horizontal across the page, at the top of the page. When I hover over a top level menu item I want a drop down menu to appear with the same...
1
by: ralfie7 | last post by:
Is it possible to create a pure CSS (no JS) horizontal drop-down navigation menu using only css AND use includes for that navigation item? Most of the examples I see do not put their navigation in an...
0
by: aboutjav.com | last post by:
Hi, I am new at asp.net and want to add a horizontal dropdown menu like toolstripmenu in windows form. I found a drop down menu written in javascript (DHTML). How do I add to my asp.net project....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.