我想在自定义MainDiv中对齐多个(在本例中为3个)div,以获得如下结果:
<div style="position: fixed; width:100%; height: 12%; left:0%; top: 0%; background: black">
<div style="color: white; left: 5%; margin-top: 5%; position: fixed; font-size: 10px">INFORMATION A</div>
<div style="color: white; margin:0 auto; margin-top: 5%; display: table; font-size: 10px">INFORMATION B</div>
<div style="color: white; right: 5%; margin-top: 5%; position: fixed; font-size: 10px">INFORMATION C</div>
</div>
&#13;
我该如何解决这个问题?
答案 0 :(得分:0)
你可以使用flex-layouting
<div style="position: fixed; width:100%; height: 50%; left:0%; top: 0%; background: black; display: flex; justify-content: space-between;">
<div style="color: white; left: 5%; margin-top: 5%; position: fixed; font-size: 10px">INFORMATION A</div>
<div style="color: white; margin:0 auto; margin-top: 5%; display: table; font-size: 10px">INFORMATION B</div>
<div style="color: white; right: 5%; margin-top: 5%; position: fixed; font-size: 10px">INFORMATION C</div>
</div>