Forum Moderators: not2easy

Message Too Old, No Replies

margin float problem

         

zls0424

3:15 am on Jun 22, 2007 (gmt 0)

10+ Year Member



The following code works as I want on firefox, but a little different on ie. It seems that the float inherits its parentnode's margin-right as its padding-right. Any ideas?


<!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" >
<head>
<style>
body {width: 80%;}
#contentmr {margin-right: 164px; border: 1px solid #444;}
.fright {float: right;}
</style>
</head>
<body>
<div id="contentmr">
<div class="fright">
<input type="button" value="New" />
</div>
Test text
</div>
</body>
</html>

DrDoc

3:33 am on Jun 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Which version of IE? Or all of them?

zls0424

6:11 am on Jun 22, 2007 (gmt 0)

10+ Year Member



6.0

Just found the solution at [positioniseverything.net...]

Thank you all the same:)