我需要在同一行中显示一个包含一些内容的div,下面是代码,它工作正常但是当文本长度较大时最后一个div的垂直位置向上移动,我需要每个div正确对齐.
<div id="bootmPanel" style=" box-shadow: 0px 0px 12px rgba(255,255,255,0.7);border: 0px solid rgba(244,244,244,0.7); position: absolute;right:0; bottom: 0;display:block;background-color:rgba(52,47,52,.7);width:100%;height:200px" >
<div style="padding:5px;width:105px;height:130px;border:1px solid rgba(244,244,244,1);margin-top: 10px;margin-left: 10px; display:inline-block;">
<img src="images/icon/alert.png" width=70px; height:30; alt="Alert" style="margin-top: 5px;margin-left: 10px;">
<p> <span style="color:white;font-size:12px;display:block;width:95px;word-wrap:break-word;">Images can improve the design </span> </p>
</div>
<div style="padding:5px;width:105px;height:130px;border:1px solid rgba(244,244,244,1);margin-top: 10px;margin-left: 10px; display:inline-block;">
<img src="images/icon/alert.png" width=70px; height:30; alt="Alert" style="margin-top: 5px;margin-left: 10px;">
<p> <span style="color:white;font-size:12px;display:block;width:95px;word-wrap:break-word;">Images can improve the design </span> </p>
</div>
<div style="padding:5px;width:105px;height:130px;border:1px solid rgba(244,244,244,1);margin-top: 10px;margin-left: 10px; display:inline-block;">
<img src="images/icon/alert.png" width=70px; height:30; alt="Alert" style="margin-top: 5px;margin-left: 10px;">
<p> <span style="color:white;font-size:12px;display:block;width:95px;word-wrap:break-word;">Images can improve the design </span> </p>
</div>
<div style="padding:5px;width:105px;height:130px;border:1px solid rgba(244,244,244,1);margin-top: 10px;margin-left: 10px; display:inline-block;">
<img src="images/icon/alert.png" width=70px; height:30; alt="Alert" style="margin-top: 5px;margin-left: 10px;">
<p> <span style="color:white;font-size:12px;display:block;width:95px;word-wrap:break-word;">Images can improve the design Images can improve the design </span> </p>
</div>
</div>
最佳答案
尝试将 float:left
添加到您的 div。
关于HTML div 垂直位置问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48703746/