Forum Moderators: not2easy

Message Too Old, No Replies

Float my IE6

How do I float my divs properly?

         

kcami

4:26 pm on Sep 15, 2005 (gmt 0)

10+ Year Member



Hi y'all. I'm a noob around here, so here goes -

My layout is working fine in firefox and safari. But not in IE6, as usual. I am on the verge of giving up, so any help would be much appriciated.

www: [test.osloregionen.rayon.no...]
css: [test.osloregionen.rayon.no...]

choster

4:43 pm on Sep 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Velkomen kcami!

Per the TOS [webmasterworld.com], could you post a skeleton of your HTML structure and the CSS you are using to style position the elements?

kcami

4:50 pm on Sep 15, 2005 (gmt 0)

10+ Year Member



<body>
<div id="container">
<div id="top"></div>
<div id="navcontainer">
<ul id="navlist">
<?php print ($menuHTML);?>
</ul>
</div><!-- end navcontainer -->
<div id="content">

<div class="right">
<!-- <h2>
Lorem ipsum dolor
</h2> -->
<p>
Sed ut perspiciatis unde <!-- omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae -->vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliqu voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea nulla pariatur?
</p>
</div> <!-- end .right -->

<div id="indexcenter">
<h1>
Lorem ipsum dolor
</h1>
<img class="floatleft" src="Media/Common/Images/kart.jpg" width="500" height="299" border="0" />

<div class="leftshorts">
<h2>Pressemeldinger:</h2>
<ul class="bulletfree">
<li><a href="#">Tittel (dd.mm.مم)</a></li>
<li><a href="#">Tittel (dd.mm.مم)</a></li>
<li><a href="#">Tittel (dd.mm.مم)</a></li>
<li><a href="#">Tittel (dd.mm.مم)</a></li>
</ul>
<div><a href="#">Flere pressemeldinger her...</a></div>
</div><!-- end .shorts -->
<div class="rightshorts">
<h2>Siste rapporter:</h2>
<ul class="bulletfree">
<li><a href="#">Tittel (dd.mm.مم)</a></li>
<li><a href="#">Tittel (dd.mm.مم)</a></li>
<li><a href="#">Tittel (dd.mm.مم)</a></li>
<li><a href="#">Tittel (dd.mm.مم)</a></li>
</ul>
<div><a href="#">Flere rapporter her...</a></div>
</div> <!-- end .shorts -->
<div class="clearboth"></div>
</div> <!-- end #indexcenter -->

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

<div id="footer">
<span><a href="http://www.rayon.no/">Rayon</a> &copy;</span>
</div> <!-- end footer -->
</div> <!-- end container -->

</body>

kcami

4:55 pm on Sep 15, 2005 (gmt 0)

10+ Year Member



That was the html, here's the css. I've taken away a few elements, like the menu, to easen the reading. Hope this helps.

* {
margin: 0;
padding: 0;
}

body {
text-align: left;
background: #e3e6e9;
}

#container {
font: 12px/18px Geneva, Arial, Helvetica, sans-serif;
width: 800px;
margin: 0;
text-align: left;
background-color: #fff;
color: #333;
border-right: 1px solid #777;
border-bottom: 1px solid #777;
}

#top {
padding: 0;
margin: 0;
border-bottom: 2px solid #96A18C;
background: #2a5d2d no-repeat url(../../Media/Common/Images/gmlOslo.jpg);
height: 228px;
}

#content {
padding: 5px 0 0 0;
clear: both;
background-color: orange;
}

#indexcenter {
margin-right: 270px;
border: 1px solid blueviolet;
background: palegoldenrod;
display: block;
}

#content p, #content h1, #content h2, #content h3, #content h4, #content span {
padding: 0 20px 0 20px;
}

.clearboth {
clear: both;
}

#footer {
text-align: right;
margin: 0;
padding: .5em;
color: #333;
background-color: #ddd;
border-top: 1px solid gray;
clear: both;
}

div#footer span {
font-size: 10px;
color: #545454;
padding-right: 2em;
clear: both;
}

.floatright {
float: right;
margin: 0 0 10px 10px;
clear: right;
border: 0px solid #666;
padding: 3px;
}

.floatleft {
float: left;
margin: 10px 10px 10px 0;
clear: left;
border: 0px solid #666;
padding: 1px;
}

img.floatleft {
margin: 0 0 10px 10px;
border: 1px solid #96A18C;
}

.article {
padding: 19px 0;
background: #fff url(../../Media/Common/Images/fade.gif) repeat-x top left;
}

.right {
position: relative;
width: 260px;
float: right;
margin: 1.7em 0 0 0;
padding: 0;
clear: right;
border: 0px solid #96a18c;
background: transparent;
}

.right p {
padding: 0;
margin: 0;
}

.leftshorts {
position: relative;
float: left;
margin: 0;
}

.rightshorts {
position: relative;
float: left;
margin: 0;
}
.leftshorts, .rightshorts {
width: 240px;
padding: 0;
border: 1px solid #96A18C;
background: #DEE6D8;
}

html>body .leftshorts {
float: left;
margin: 0 10px 0px 10px;
}
html>body .rightshorts {
float: right;
margin: 0 16px 10px 0px;
}

.leftshorts h2, .rightshorts h2 {
padding: 1px 0;
background: url(../../Media/Common/Images/osX_style.jpg) repeat-x center;
color: #000;
font-size: 1.1em;
margin-bottom: .8em;
border-bottom: 1px solid #96A18C;
}

.leftshorts ul, .rightshorts ul {
margin: 0 10px 10px 0px;
}
.leftshorts div, .rightshorts div {
margin: 0 10px 10px 0px;
}

.leftshorts a, .rightshorts a {
padding-left: 20px;
text-decoration: none;
color: #145671;
}
.leftshorts a:hover, .rightshorts a:hover {
padding-left: 20px;
background: url(../../Media/Common/Images/arrowbullet.gif);
background-position: 0 -14px;
background-repeat: no-repeat;
color: #000;
}

#left {
position: relative;
width: 120px;
float: left;
margin: 2em 0 0 10px;
padding: 0;
border-right: 0px solid green;
}