relative positioning in Firefox
First, thanks for the great book, it has help me a great deal. You gave me a fix for the first problem I encountered and I'm hoping you will have some ideas for my lastest problem that I can't find an answer for.
I have a relatively positioned div and a couple of relatively positioned divs inside of the first, both floated right. The first div, as I understand things, should expand to encompass the other two and does just that in IE, but not Firefox. I have tried different height values(auto, 100%) but the only way it works is if I define a definite value (100px). This does not work as the contents of the two inner divs are based on user input from a database and may therefore their height depends on how much text the user inputs.
a quick sample code:
<style type='text/css' media='all'>
#content {
border: thin solid green;
position: relative;
width: 800px;
left: 50%;
margin-left: -400px;
height: auto;
}
#p1 {
border: thin solid black;
position: relative;
float: right;
width: 600px;
}
#p2 {
border: thin solid yellow;
position: relative;
float: right;
width: 600px;
}
</style>
<body>
<div id='content'>
<div id='p1'>
test text here. test text here. test text here.
test text here. test text here. test text here.
</div>
<div id='p2'>
test text here. test text here. test text here.
test text here. test text here. test text here.
</div>
</div>
</body>
</html>
I kind of hope this is a bug in Firefox and I'm not just missing something obvious.
Thanks in advance
|