...

View Full Version : Firefox & ie6 display problems.



srule_
07-05-2007, 08:19 PM
Hey, My 1st post, ya!

anyway, i'm having a problem with my css layout.

1. In firefox my nav bar goes out of the "container div". I tryed making the width smaller but then it does not center good as there is an extra 40px on the left.

2. In ie6 my content divs clash making the left hand one drop. also the footer div is to big.

if u want to view the problems then this is the web page: http://forestlakes.50webs.com/index.htm

HTML Code:


<body>
<div id="wrapper">
<div id="container">
<div id="header">
</div>
<div id="nav">
<ul class="nav">
<li><a href="http://www.google.ca">Calander </a></li>
<li><a href="http://www.google.ca"> Workshop </a></li>
<li><a href="http://www.msn.com"> Volunteer </a></li>
<li><a href="http://www.newschoolers.com"> What's Next </a></li>
<li><a href="http://www.google.ca"> Contact Us </a></li>
<li><a class="end" href="http://www.newschoolers.com"> Forest Lake Map </a></li>
</ul>
</div>
<div id="contentleft">
</div>
<div id="contentright">
</div>
<div id="footer">
</div>
</div>
</div>
</body>



CSS Code


body {
margin: 0px;
padding: 0px;
font-family:Verdana, sans-serif;
font-size:12px;
}

#wrapper {
width:760px;
margin: 0 auto 0 auto;
}

#container {
float:left;
width:760px;
border:1px solid black;
background-color:#b1d07f;
}

#header {
width:760px;
background: url(images/Headerbg.gif) top left no-repeat;
height:198px;
}

ul.nav {
list-style:none;
width: 780px;
background-color:#e8e8e8;
text-align: center;
margin-top:0px;
padding-top:5px;
padding-bottom:5px;
margin-left:-20px;
}

ul.nav li {
display: inline;
}

a.end {
border-right: 1px solid black;
padding-right: 5px;
padding-left: 5px;
}

ul.nav a{
border-left: 1px solid black;
font-weight:bold;
text-decoration:none;
padding:5px;
text-align: center;
color:#000000;
}

ul.nav a:hover {
color:#FFFFFF;
background-color:#000000;
}

#contentleft {
width: 350px;
float: left;
border:2px solid #b6dc86;
margin-top: 20px;
margin-left: 20px;
padding-top: 20px;
}

#contentright {
width: 350px;
float: right;
border:2px solid #b6dc86;
margin-top: 20px;
margin-right: 20px;
padding-top: 20px;
}

#footer{
border:2px solid #b6dc86;
margin-top: 20px;
margin-left: 20px;
margin-bottom: 20px;
padding-top: 20px;
width: 720px;
float: left;
}

Jutlander
07-05-2007, 09:37 PM
Remove the line marked in red:


ul.nav {
list-style-type: none;
background-color:#e8e8e8;
text-align: center;
margin-top:0px;
padding-top:5px;
padding-bottom:5px;
margin-left:-20px;
}

Switch out your #contentright with this instead:


#contentright {
width: 350px;
float: left;
clear: right;
border:2px solid #b6dc86;
margin-top: 20px;
margin-right: 20px;
padding-top: 20px;
}

I have floated it left and cleared it right. As a last thing you might want to add some right margin to #contentleft. :)

Jutlander
07-05-2007, 10:07 PM
OK, after later testing I found out that would cause some trouble. I've reworked your layout a little. Try it out.

HTML:


<body>

<div id="wrapper">

<div id="header"></div>

<ul class="nav">
<li><a href="http://www.google.ca">Calander </a></li>
<li><a href="http://www.google.ca"> Workshop </a></li>
<li><a href="http://www.msn.com"> Volunteer </a></li>
<li><a href="http://www.newschoolers.com"> What's Next </a></li>
<li><a href="http://www.google.ca"> Contact Us </a></li>
<li><a class="end" href="http://www.newschoolers.com"> Forest Lake Map </a></li>
</ul>

<div id="contentwrap">

<div id="contentleft">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.</div>
<div id="contentright">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.</div>
<div id="footer">Some info here</div>
</div>
</div>

</body>

CSS:


* {
margin: 0;
padding: 0;
}

body {
font-family:Verdana, sans-serif;
font-size:12px;
}

#wrapper {
width: 720px;
margin: 0 auto;
border:1px solid black;
background-color:#b1d07f;
}

#contentwrap {
padding: 20px;
}

#header {
background: url(images/Headerbg.gif) top left no-repeat;
height:198px;
}

ul.nav {
list-style-type: none;
background-color:#e8e8e8;
text-align: center;
margin-top:0px;
padding-top:5px;
padding-bottom:5px;
}

ul.nav li {
display: inline;
}

a.end {
border-right: 1px solid black;
padding-right: 5px;
padding-left: 5px;
}

ul.nav a{
border-left: 1px solid black;
font-weight:bold;
text-decoration:none;
padding:5px;
text-align: center;
color:#000000;
}

ul.nav a:hover {
color:#FFFFFF;
background-color:#000000;
}

#contentleft {
float: left;
border:2px solid #b6dc86;
width: 305px;
margin-bottom: 20px;
margin-top: 20px;
padding: 10px;
}

#contentright {
float: right;
clear: right;
border:2px solid #b6dc86;
width: 305px;
margin-bottom: 20px;
margin-top: 20px;
padding: 10px;
}

#footer{
border:2px solid #b6dc86;
clear: both;
}

srule_
07-06-2007, 12:46 AM
Thanks, it works great!!

wish i could fix stuff like this myself as i always run into the same problems...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum