【发布时间】:2021-12-05 03:05:47
【问题描述】:
我正在尝试水平对齐三个 div。 中心 div 正在切入左侧 div。 我做错了什么?
<div>
<div style={{width:"100px", border:"solid blue", float:"left"}}>Left some text some text some text</div>
<div style={{width:"100px", border:"solid green", float:"right"}}>Right</div>
<div style={{border:"solid red", margin:"0 auto"}}>Center</div>
<div style={{clear:"both"}}></div>
</div>
中心也与右侧的绿色框重叠,但边框大小相同,因此您看不到它。
【问题讨论】:
-
这些答案解决了你的问题吗?
标签: html css reactjs css-float