CSS div float

CSS float属性 CSS div float

The float property sets where an image or a text will appear in another element.
float属性可设置在另一个元素中的图片或是一段文字在哪出现。

Note: If there is too little space on a line for the floating element, it will jump down on the next line, and continue until a line has enough space.
注意:如果在一行空间上的浮动元素过多,超出了空间的容纳范围,它就会自动跳到下一行中,直到一行有足够的空间容纳它。

Note: Content, background, and borders of inline elements should go in front of the float. Background and borders of a block element should go behind the float, but the content of the block element should go in front of the float.
注意:在inline元素中的内容,背景以及边框会在浮动层的上面。block元素的背景边框则会在浮动层的下面,而内容会在其上面。

Inherited: No
继承性:无

Example
举例
img
{
float: left
}
Possible Values
可能用到的值
Value
描述
left
The image or text moves to the left in the parent element
图片或是文字移动到父层的左边
right
The image or text moves to the right in the parent element
图片或是文字移动到父层的右边
none
The image or the text will be displayed just where it occurs in the text
图片或是文字回到它本应该出现的位置
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值