I have a menubar <div> that has width 610px, located in a containing <div> of width 780px
The menubar is between <center> tags, and on all browsers except IE5.2.3(Mac) it decides to shift left, hard up against the left side of the containing element. CSS as follows;
#navbar {
width:610px;
height:2em;
}
The containing <div> does not specify text-align. Although I did try center alignment, which failed to make a difference.
A tried float:left, and float:right, but it just wants to stay hard up against the left.
I keep dumping the browser cache because to begin with, it just kept loading old pages.
Stupid browser.
Any ideas would be welcome.
Thanks,
JohnLike this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>menubar</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
#container {
border:1px solid #000;
width:780px;
}
#menubar {
margin:0 auto;
border:1px solid #9cf;
width:610px;
}
-->
</style>
</head>
<body>
<div id="container">
<div id="menubar">menubar</div>
</div>
</body>
</html>Thanks for the tip, but it didn't do the trick. It should, as that's exactly how my container <div> sits in the <body>
and I know that works becuase my container does sit in the middle of the page.
body {
background-color: #E0E0E0;
margin: 10px 0 10px 0;
text-align: center;
}
#container {
margin:auto;
width: 780px;
background-color: #FFFFFF;
border:1px solid #D0D0D0;
}
#navbar {
width:610px;
margin: auto;
height:2em;
}
I tried as per your text for navbar; margin:0 auto; but that didn't do it.
It's only IE5.2.3(Mac) that's giving me this.
Thanks again for taking time to look
Never mind, I got it working.
I'm not sure which of my changes did it, but the menubar is now centred.
I'm running PHP locally, and for some reason can't view the local server using IE, but Netscape/Mozilla/Safari all connect to it no problems, that's why I didn't verify with IE. Only when I connect to the internet can I view the local PHP documents, and it was just now as I discovered this, that I realised the menubar on IE was now infact centered. So when viewing the same on the internet, it too was centred, so, it seems I have a problem dumping the cache/history etc...
I do it manually all the time, plus use another freeware called Cache Out, which goes through the installed browsers and dumps their temp files etc.., but IE just hangs in there with some stuff causing each update I make not to be displayed.
Oh well, such is life!
The menubar is between <center> tags, and on all browsers except IE5.2.3(Mac) it decides to shift left, hard up against the left side of the containing element. CSS as follows;
#navbar {
width:610px;
height:2em;
}
The containing <div> does not specify text-align. Although I did try center alignment, which failed to make a difference.
A tried float:left, and float:right, but it just wants to stay hard up against the left.
I keep dumping the browser cache because to begin with, it just kept loading old pages.
Stupid browser.
Any ideas would be welcome.
Thanks,
JohnLike this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>menubar</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
#container {
border:1px solid #000;
width:780px;
}
#menubar {
margin:0 auto;
border:1px solid #9cf;
width:610px;
}
-->
</style>
</head>
<body>
<div id="container">
<div id="menubar">menubar</div>
</div>
</body>
</html>Thanks for the tip, but it didn't do the trick. It should, as that's exactly how my container <div> sits in the <body>
and I know that works becuase my container does sit in the middle of the page.
body {
background-color: #E0E0E0;
margin: 10px 0 10px 0;
text-align: center;
}
#container {
margin:auto;
width: 780px;
background-color: #FFFFFF;
border:1px solid #D0D0D0;
}
#navbar {
width:610px;
margin: auto;
height:2em;
}
I tried as per your text for navbar; margin:0 auto; but that didn't do it.
It's only IE5.2.3(Mac) that's giving me this.
Thanks again for taking time to look
Never mind, I got it working.
I'm not sure which of my changes did it, but the menubar is now centred.
I'm running PHP locally, and for some reason can't view the local server using IE, but Netscape/Mozilla/Safari all connect to it no problems, that's why I didn't verify with IE. Only when I connect to the internet can I view the local PHP documents, and it was just now as I discovered this, that I realised the menubar on IE was now infact centered. So when viewing the same on the internet, it too was centred, so, it seems I have a problem dumping the cache/history etc...
I do it manually all the time, plus use another freeware called Cache Out, which goes through the installed browsers and dumps their temp files etc.., but IE just hangs in there with some stuff causing each update I make not to be displayed.
Oh well, such is life!