Forum Moderators: not2easy

Message Too Old, No Replies

IE disappearing div

         

CompressedAir

12:09 am on Jun 8, 2005 (gmt 0)

10+ Year Member



Hey guys,
IE's never ending series of bugs continues. This is a great one where IE will make a div magically disappear! I've tried for about 5 hours trying to figure out how to get this working, but I can't seem to get IE to display this properly.

<!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">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>IE...</title>
<style>
/* =Header
----------------------------------------------- */

#header {
text-align: center;
border-bottom: 1px solid #014e82;
margin: 0;
padding: 0;
height: 120px;
}

/* =General Structure
----------------------------------------------- */
body {
margin: 0;
padding: 0;
background-color: gray;
font-size: small;
font-family: Trebuchet MS, Trebuchet, Verdana, Geneva, Arial, sans-serif;
}
#content {
border: 2px solid red;
margin: 0 150px;
background-color: purple; /*deleting this line will also oddly solve this problem? */
}
#cont {
background: purple;
}
/* =Posts
----------------------------------------------- */

.post {
margin: 1em;
padding: .5em;
border: 0px dotted #000;
display: block;
}
.entry {
border: 1px solid #ddd;
margin: 0;
padding: 0;
}
.clearme {
clear: both;
}
/* =Views
----------------------------------------------- */
.view {
border: 2px solid red;
}
.left,.right {
clear: both;
width: 40%;
}
.left {
border: 1px solid #FC5A6A;
background: #FEB9C0;
margin-left: 3%;
float: left;
}
.right {
border: 1px solid #82CAFC;
background: #D2ECFE;
clear: right;
float: left; /* this turns on IE's magic */
}
html>body .left,.right {
width: 45%;
}
html>body .left {
margin-left: 5%;
}
.postmetadata {
display: block;
clear: both; /* changing this will also make it reappear */
}
</style>
</head>
<body>
<div id="content">
<div class="post">
<h2><a href="url">lorem</a></h2>
<div class="entry">
<p>Lorem ipsum <a href="Url">URL</a> dolor sit amet, consectetuer adipiscing elit. Quisque pharetra, eros porttitor suscipit aliquam, urna libero condimentum leo, nec fermentum wisi libero quis nisl. Maecenas ligula augue, placerat nec, vestibulum imperdiet, ornare in, enim. Aenean ut elit. Morbi cursus feugiat tellus. Aliquam egestas. Donec egestas. Etiam sagittis urna sit amet sem. Etiam euismod. In hac habitasse platea dictumst. Aliquam et ipsum sit amet enim dictum condimentum. Mauris sodales. Nunc nibh elit, scelerisque ut, volutpat non, rhoncus sit amet, dolor. Nunc diam magna, venenatis quis, mollis eu, ullamcorper vitae, felis. Praesent quis sapien. Fusce hendrerit turpis at lorem. Aenean justo turpis, malesuada in, sodales quis, euismod ac, elit. Fusce eget lorem vel magna lacinia hendrerit. In rhoncus venenatis dui.</p>
<div class="clearme"></div>
</div>
<div class="view">
<div class="left"><p>LEFT</p></div>
<div class="right"><p>RIGHT</p></div>
</div> <!-- view close -->
<div class="postmetadata"><a href="url">Comments</a></div>
</div>

</body>
</html>


The design structure must be maintained. Putting the postmetadata class above the entry class will also solve this problem, but I need the comments link to be below, which causes this problem. You can check Firefox as always for the proper display. Oh yeah, if you move a window over the webpage, the div will also magically appear.
Unfortunately, none of these are valid options. If anyone knows what I can do to fix this, I'd appreciate it!

Moby_Dim

5:51 am on Jun 8, 2005 (gmt 0)

10+ Year Member



Always try to find your own mistake first and check for validity. In this case count open and closing DIVs to compare ;), then insert missed /div before "postmetadata" div , and your IE will be magically cured ;)

CompressedAir

11:42 pm on Jun 8, 2005 (gmt 0)

10+ Year Member



Oh thanks. It seems like it didn't paste correctly. Where the empty line is, is where the </div> should close, not before then. However, I think I've found the solution. Using IE's zoom feature adding zoom:1 to the #content id seems to make it magically reappear.
Thanks again.