a86356
a86356

Reputation: 121

how to clear float the right img

i have two img and float them.like this

img{
  float:left;
  clear:right;
}
<img src='http://img1.imgtn.bdimg.com/it/u=1005212286,2432746147&fm=21&gp=0.jpg' alt=''>
<img src='http://img1.imgtn.bdimg.com/it/u=1005212286,2432746147&fm=21&gp=0.jpg' alt=''>

i am confused why right img still float behind the first img. i think the second img will go to next line.Can someone tell me why?

Upvotes: 0

Views: 51

Answers (1)

Jared Goertzen
Jared Goertzen

Reputation: 92

You are close!

img {
 float: left;
 clear: both;
}

Upvotes: 2

Related Questions