Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有 3 个 div 彼此相邻:
<div style="left: float;">1</div> <div style="left: float;">2</div> <div style="left: float;">1</div>
这应该看起来像:
content content page 1 content page 2
所以页面 X 应该与底部对齐。我看到一些“相对于父母,绝对+底部 0 为孩子 - 没有工作!
浮动是一个糟糕的选择,你希望你的元素是内联块并调整垂直对齐:
http://tinker.io/f6b9e
div { display: inline-block; vertical-align: text-bottom; } <div>1</div> <div>2</div> <div>1</div>