473,395 Members | 1,403 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,395 software developers and data experts.

Dropdown list not so crossbrowser

Hi,

I have create a dropdown menu which looks as expected in Safari (Mac).
Viewing it in FF (Mac) or IE6 (Windows) it's a bit messed up.
It also seems that when the top level links are clicked (#nogo) the whole structure collapses.

I'm staring to this code for hours now, but I can't figure out why it is not cross-browser, compatible, valid etc.

Could someone please take a look at the code and provide suggestions how to improve it.

Thank you very much.

Aad

[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
/* ----------------------------- CSS starts here ----------------------------- */
.menu {
width:500px;
height:50px;
position:relative;
margin-top: 2em;
margin-right: 0px;
margin-bottom: 0;
margin-left: 225px;
z-index: 1000;
background-color: #fff;
background-repeat: no-repeat;
background-position: 0 20px;
}

/* get rid of the default padding - margin and bullets */
.menu ul {
padding:0;
margin:0;
list-style-type: none;
}

/* make menu horizontal */
.menu ul li {
float:left;
position:relative;
}

/* set up the default top level links */
.menu ul li a, .menu ul li a:visited {
font-family: verdana, arial, sans-serif;
display:block;
text-decoration:none;
width:110px;
height:1.5em;
font-weight:bold;
color:#BBBBBB;
border-bottom:8px solid #BBBBBB;
background:#fff;
padding-left:0px;
line-height:.5m;
margin-right:5px;
list-style-type: none;
list-style-image: none;
text-transform: uppercase;
text-align: center;
font-size: 14px;

}

/* hack for IE5.5 to correct the faulty box model */
* html .menu ul li a, .menu ul li a:visited {
width:98px;
w\idth:88px;
}

/* hide the drop down menu */
.menu ul li ul {
display: none;
}

/* remove all table style so that it does not interfere with the menu */
.menu table {
margin:-1px;
border-collapse:collapse;
font-size:1em;
}

/* first line for IE7 and non-IE browsers, second line for IE5.5 and IE6 */

/* style the top level hover */
.menu ul li:hover a,
.menu ul li a:hover {
color: #01A0C7;
border-bottom:8px solid #01A0C7;
}


/* make the drop down menu show and correctly position it */
.menu ul li:hover ul,
.menu ul li a:hover ul {
display:block;
position:absolute;
top:1em;
margin-top:11px;
width:108px;
border:1px solid #01A0C7;
border-top:0;
background-color: #FFFFFF;
}


/* style the drop down links with no hover */
.menu ul li:hover ul li a,
.menu ul li a:hover ul li a {
display:block;
background-color: #FFFFFF;
border:0;
margin:0;
color:#BBBBBB;
font-weight:bold;
font-size: 12px;
height:auto;
line-height:1em;
padding:5px;
width:96px
}

/* style the drop down menu links when hovered */
.menu ul li:hover ul li a:hover,
.menu ul li a:hover ul li a:hover {
background:#01A0C7;
color:#fff;
width: 99px;
}


/* IE5.5 hack for faulty box model in drop down menu */
.menu ul li a:hover ul li a {
background:#ddd;
width:96px; /* for IE5.5 faulty box model */
w\idth:86px; /* for IE6 */
}

</style>
</head>

<body>

<div class="menu">
<ul>
<li><a class="drop" href="http://www.samplesite123.com" title="Back to Homepage"> Home<!--[if IE 7]><!--></a><!--<![endif]-->

<!--[if lte IE 6]></a><![endif]-->
</li>

<li><a href="#nogo">Parts<!--[if IE 7]><!--></a><!--<![endif]-->
<table><tr><td>
<ul>
<li><a href="page1.html" title="Sample page 1">Page 1</a></li>
<li><a href="page2.html" title="Sample page 2">Page 2</a></li>
<li><a href="page3.html" title="Sample page 3">Page 3</a></li>
</ul>
</td></tr></table>
<!--[if lte IE 6]></a><![endif]-->
</li>

<li><a href="#nogo">Parts (2)<!--[if IE 7]><!--></a><!--<![endif]-->
<table><tr><td>
<ul>
<li><a href="page4.html"title="Sample page 4">Page 4</a></li>
<li><a href="page5.html" title="Sample page 5">Page 5</a></li>
</ul>
</td></tr></table>
<!--[if lte IE 6]></a><![endif]-->
</li>

<li><a href="#nogo">Parts (3)<!--[if IE 7]><!--></a><!--<![endif]-->
<table><tr><td>
<ul>
<li><a href="page6.html" title="Sample Page 6">Page 6</a></li>
</ul>
</td></tr></table><!--[if lte IE 6]></a><![endif]-->
</li>
</td></tr></table>
<!--[if lte IE 6]></a><![endif]-->
</li>
</ul>
</div>

</body>
</html>
[/HTML]
Jul 16 '07 #1
1 2400
drhowarddrfine
7,435 Expert 4TB
Validate your html and css for your list of errors to correct.
Jul 16 '07 #2

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

Similar topics

1
by: Joseph Barron | last post by:
Here is a SIMPLE problem that I'm trying to solve. It works in Netscape 6.2, but IE6 gives ""No such interface supported." Below are page1.htm and page2.htm . In page1.htm, there are two...
6
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. ...
3
by: Steel | last post by:
Hi at all, I'ld want to know if position:absolute is crossbrowser. Infact I cannot position absolutely an element in the some place with fox-pro and MSIE6 There is always a little difference...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
5
by: jung_h_park | last post by:
From: jung_h_park@yahoo.com Newsgroups: microsoft.public.dotnet.framework.aspnet Subject: Dropdown List not retaining its SelectedValue Date: Mon, 26 Jun 2006 21:02:57 -0700 Hello, My...
3
by: er1 | last post by:
Hi all, I have created a double dropdown list. Based on the first list selection, second list populates (this works fine). I have a submit button, which when clicked should run a select query...
6
by: yasodhai | last post by:
Hi, I used a dropdown control which is binded to a datagrid control. I passed the values to the dropdownlist from the database using a function as follows in the aspx itself. <asp:DropDownList...
3
by: fish919 | last post by:
Hello All, I am creating a date base in access. I want to create a dropdown list box that is connected to another dropdown list box. You start with a dropdown list that has 5 choices and each of...
5
by: abhi3211 | last post by:
i am using java inside java script page. in that page i want to use two dropdown list. in first dropdown list i am getting data from ms-access database. in second dropdown list i want to get data...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.