i have a problem in html and css. that's,check the div is in the below order
<div class="parent">
<div class="child1">
</div>
<div class="child2">
</div>
</div>
.child1 { float:right; width:auto; }
.child2 { float:right; width:200px; }
in this the div child1 is a horizontal growing div. so its not possible to add specific width to the div. what i need to show the child1 and child2 div in same horizontal line. if child1 is empty the child2 will be the rightmost div. the above solution don't work in ie7. please help me to find a solution.
please check this image.
- 开发者_高级运维
- image 1: rendering in chrome
- image 2: rendering in ie7
thanks in advance.
swap their order in the html.
Rigth floats are "inverted".
like this:
<div class="parent">
<div class="child2">
</div>
<div class="child1">
</div>
</div>
may be you have to define standard doctype
like this <!DOCTYPE html>
in your html page
精彩评论