CSS之元素浮动 float: left

in wherein •  4 years ago 

CSS之元素浮动 float: left

通常块级元素会独自占一行,且宽度会占满父元素宽度。
当希望多个块级元素能并排在一行显示时,此时可将每个块级元素赋予float属性,并设值为left或right(视需求而定)。
此时每个块级元素将按照设定的方向,并排在一行显示。
当宽度超过行宽时,会自动换行至下一行。

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

This post has been rewarded by the Steem Community Curation Project. #wherein 添加 wherein小助手 微信:cnsteem ,加入到WhereIN大家庭,期待你的加入.