Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I can float Nav in chrome and firefox but not ie. I am stumped (help)

Status
Not open for further replies.

csphard

Programmer
Apr 5, 2002
194
US

Using css I tried to float my nav to the right side to be inline with this image.

It works on chrome and firefox but not ie.. Can anyone tell me why?


Thanks Howard

<html><head>

<link rel="stylesheet" type="text/css" href="sample2.css">
<title>Fpe</title>
<style>
body{background: url(images/new1.jpg) center top no-repeat;font-family: verdana;font-size:11px;text-align:center;}
h1,h2,h3,h4,h5,h6,ul,li,a,img,body{margin:0;padding:0;}
img {border:0;}
#container{width:874px;height:600px;margin:0 auto;position:relative;text-align:left;}
#header{height:180px;}
#header h1{background: url(images/logo2.png) left bottom no-repeat;height:180px;}
#header span{display:none;}
#cheader {width:874px;border:1px solid red;height:300px;} /* used to break up header 1 and header 2 */
#nav{float: right;margin:50px 140px 0 0; border:1px solid green;width:200px;}
#nav ul {list-style: none;}
#nav li {font-weight:bold;height:32px;}
#nav li a {text-decoration:none;font-size: 40px; color:black;}
#nav li a:hover {color: #c6c6c6;}
#nav li a:visited {color: gray}

</style>
</head><body>
<div id="container">
<div id="header"><h1><span>HEADER</span></h1></div>

<div id="content">
<div id="cheader">
<img src="images/2model.jpg" width="461" height="288">
<div id="nav">
<ul>
<li><a href="#">HOME</a></li>
<li><a href="#">MODELS</a></li>
<li><a href="#">EVENTS</a></li>
<li><a href="#">PRODUCTS</a></li>
<li><a href="#">CONTACT</a></li>
</ul>
</div>
</div>






</div> <!-- content end -->
</div> <!-- container end -->

<div id="footer">


</div><!-- footer end -->
</body></html>
 
Most likely problem is no doctype specified, therefore browser will drop into quirks mode. See
In general if you have any problems with layout start by using a validator which will help you resolve almost all of the problems straight off. See
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
right float elements have to be in the document flow before any elements that should be on the same horizontal row as the floated element.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top