Forum Moderators: not2easy

Message Too Old, No Replies

Which browser is correct for this CSS?

CSS Browser problem

         

zastil

11:06 am on Mar 25, 2004 (gmt 0)

10+ Year Member



in ie position:Absolute is in wrong place, yet mozilla is correct. Any fix?

<div style="margin-left:100px">
<div style="clear:both;">
<div style="float:left;position:absolute">Testing</div>
<div style="margin-left:100px;">Testing<br>red<br>red<br>red<br>red<br>red</div>
</div>
<div style="clear:both;">
<div style="float:left;position:absolute">ccccx</div>

<div style="margin-left:100px;">Testing<br>red<br>red<br>red<br>red<br>red</div>
</div>
</div>

grahamstewart

11:15 am on Mar 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well your CSS is sort of wrong there.
You can't really specify float:left and position:absolute on the same thing - it doesn't make any sense.

Stratus42

11:20 am on Mar 25, 2004 (gmt 0)

10+ Year Member



Hi zaztil

I'm not quite sure what you're trying to acheive.. which effect ..etc.. but right away I noticed a few problems with your code above. -- you've got a start tag with no end and an end tag with no start.. so IE is probably ignoring it and mozilla is probably getting confused .. that's my first guess


<div style="margin-left:100px">
<div style="clear:both;">
<div style="float:left;position:absolute">Testing</div>

<div style="margin-left:100px;">Testing<br>red<br>red<br>red<br>red<br>red</div>

</div> <!--this is a end tag with no beginning-->

<div style="clear:both;"> <!--this is a beginning tag with no with no end-->

<div style="float:left;position:absolute">ccccx</div>

<div style="margin-left:100px;">Testing<br>red<br>red<br>red<br>red<br>red</div>
</div>
</div>

zastil

11:22 am on Mar 25, 2004 (gmt 0)

10+ Year Member



Yeah I have tried loads todo what I want.

If you float:left then have parent div background there is no color in IE but mozilla yes.

Example


<div style="background-color:red">
<div style="float:left">dynamic text here</div>
</div>

Stratus42

11:32 am on Mar 25, 2004 (gmt 0)

10+ Year Member



hm.. still not sure what you're trying to do..

But, if you are trying to make 2 colums - one that is 100 px from the left with a red background and one that is 100px to the left of that without a red background, this seems to work well for me cross browser.


<div style="margin-left:100px;">
<div style="float:left; background-color:red;">
<p>Testing</p>
<p> ccccx <br />red<br />red<br />red<br />red<br />red<br />red<br /></</p>
</div>
<div style="margin-left:100px;">
<p>Testingp>
</div>
</div>

You've got a lot of <div>s in the example you posted and it's hard to see what you're trying to do.

Stratus42

11:37 am on Mar 25, 2004 (gmt 0)

10+ Year Member



oops;. you might want to put a "<" on that last <p> tag there.. I see I entered a typo

zastil

12:54 pm on Mar 25, 2004 (gmt 0)

10+ Year Member



I got it working in both now....

<div style="float:left;background-color:red">
<div style="float:left">****xx</div>
<div style="float:left">yyyyyy<br>yyyyyy<br>yyyyyy<br>yyyyyy</div>
</div>