Mayur
Mayur

Reputation: 3005

clear property is not working in ie 7

I m using a div in my web site by using float:left and float:right after that is used clear:both, its working fine in all browser except ie7 i have tried a lot of things please tell me a solution to resolve this problem....

css:

.clear
{
    clear : both;
    margin : 0px;

} 

html:

<div style="float:left">some text</div>
<div style="float:left">some text</div>
<div class="clear"></div> 
<div style="float:left">some text</div>
<div style="float:left">some text</div>

Thanks

Upvotes: 2

Views: 1545

Answers (2)

Sumit Verma
Sumit Verma

Reputation: 1

Add a div in the parent div with no content and clear it using style.For ex.

Upvotes: 0

Pekka
Pekka

Reputation: 449395

Try adding some content to the div:

 <div class="clear">&nbsp;</div> 

A much better way to do this, though, is clearfix.

Upvotes: 1

Related Questions