<style>
.floatright { float: right;margin: 0 0 10px 10px;clear: right;width:60px; height:60px; }
</style>
<img class="floatright" src="computer1.png" alt="" width="60" height="60">
<img class="floatright" src="computer2.png" alt="" width="60" height="60">
<img class="floatright" src="computer3.png" alt="" width="60" height="60">
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
</p>
问题:
这里clear: right;
将图像堆叠在一起,但为什么不能使用clear: left;
?,根据这里:http ://www.w3schools.com/cssref/pr_class_clear.asp ,据说:
clear:left, No floating elements allowed on the left side
所以这意味着如果我使用clear:left
in .floatright
,每个图像的左侧都不允许有浮动元素,因此,所有图像都会堆叠在一起,但实际上不是,clear:left
什么都不做,为什么?