473,287 Members | 1,866 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,287 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 2396
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.