views:

154

answers:

5

Here's a weird bug I've found, IE8 is duplicating my div, but only a part of it.

How it looks in IE8: alt text

And here's how it's meant to look in FF: alt text

And the HTML:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

    \/\/\

 <div id="roundbigbox">
    <p id="pro">Produkter</p>

        <div id="titles">

    <div id="thinlinecopy"></div>
    <div id="varekodetext">
     <p>Varekode</p>
    </div>
    <div id="produkttext">
     <p>Produkt</p>
    </div>
    <div id="pristext">
     <p>Pris</p>
    </div>
    <div id="antalltext">
     <p>Antall</p>
    </div>
    <div id="pristotaltext">
     <p>Pris total</p>
    </div>
    <div id="sletttext">
     <p>Slett</p></div>
    <div id="thinline"></div>
    </div>


...content...


    <div class="delete">

   <a id="slett" href="/order/delete/1329?return=" title="Slett"><!--Slett--></a>
            </div>

    </div>

CSS for FF:

div #roundbigbox {
    background-image:url(../../upload/EW_p_og_L.png);
    background-position:top center;
    background-repeat:no-repeat;
    padding:5px;
    padding-top:10px;
    padding-bottom:0px;
    width:760px;
    height:1%;
    border-width:1px;
    border-color:#dddddd;
    border-radius:10px;
    -moz-border-radius:10px;
    -webkit-border-radius:10px;
    z-index:1;
    position:relative;
    overflow:hidden;
    margin:0;
    margin-bottom:10px;
    }

CSS for IE:

div #roundbigbox {
    background-image:url(../../upload/EW_p_og_L.png);
    background-position:top center;
    background-repeat:no-repeat;
    padding:5px;
    padding-right:50px;
    padding-top:10px;
    width:760px;
    height:1%;
    border-width:1px;
    border-color:#dddddd;
    z-index:1;
    position:relative;
    overflow:hidden;
    margin:0;
    margin-bottom:10px;
    }

What could cause such a weird bug? It's not duplicated in the HTML. I am stumped!

Note: There a lot of other divs inside, one after the other.

Thanks for any responses.

A: 

You have an extra </div> at the end.

graphicdivine
That's a typo, but thanks, Sorry as well. (removed from question)
Kyle Sevenoaks
Nope. That's what I thought too, but that just ends the `div#roundbigbox` root element.
amphetamachine
OK. Do you have a valid DOCTYPE in place?
graphicdivine
Yes. I shall add it to the Question.
Kyle Sevenoaks
+1  A: 

i would say the same as: graphicdivine. plus you shoud review your CSS:

  • negative paddings do not exist :P (even in IE)
  • you can set your paddings with only one thag: padding: top right bottom left
  • same thing for border and background:

    background:url(../../upload/EW_p_og_L.png) top center no-repeat; border: 1px solid #ddd; /* when you have e hex color with 6 same characters just write 3 of them */

meo
A: 

It looks like your stylesheet may have a mistake in it:

CSS for IE:

div #roundbigbox {
    ...
    padding-bottom:-20px;
    ....
}

That may be what's causing the bottom portion to be coming up like that.

amphetamachine
I removed the `-20px` and the bottom duplicate div has shrunk in height but is still there.
Kyle Sevenoaks
A: 

try to take the comment out of the <a> tag

Sound sounds weird, but I have seen issues with this... <!--Slett-->

Mark Schultheiss
Took out all comments I had.. Still there.
Kyle Sevenoaks
I have found a few more comments, but they are outside and not related to this particular div, would that affect it? **UD** Took it out, no change.
Kyle Sevenoaks
I only had one inside a anchor tag that caused me an issue...and was not reproduceable in ALL instances either.
Mark Schultheiss
I've removed all comments I can find. The only ones left are conditional comments in the head. And it is still there.
Kyle Sevenoaks
A: 

Added this right after my div markup, it fixed it.

<div style="display:none; width:100%; margin-bottom:10px;"> </div>

Strange problem. Thanks for all your help!

Kyle Sevenoaks
and what is "this"? curious me :)
Mark Schultheiss
Strange stylesheet :)
meo
please consider accepting your own answer so people know you've solved the problem
David Morrissey
Yeah, there's a two day limit on accepting and I just got in :)
Kyle Sevenoaks
fair enough :-P
David Morrissey