我可以将位置:相对和浮动:左对齐吗? [英] Can I combine position: relative and float: left?
本文介绍了我可以将位置:相对和浮动:左对齐吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以在一个元素上同时使用位置:相对
和 float:左
吗?像这样:
Can I apply both position: relative
and float: left
on one element? Like this:
div {
float: left;
position: relative;
top: 0px;
left: 0px;
}
推荐答案
是。
一旦根据常规流程布置了箱子或漂浮 ,
可能会相对于该位置移动。这称为相对位置
"Once a box has been laid out according to the normal flow or floated, it may be shifted relative to this position. This is called relative positioning"
这篇关于我可以将位置:相对和浮动:左对齐吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文