标签:css垂直居中 item ima middle items javascrip index class lin
方法1:table-cell
.box1{ display: table-cell; vertical-align: middle; text-align: center; }
<div class="box box1"> <span>垂直居中</span> </div>
方法2:display:flex
.box2{
display: flex;
justify-content:center; //横
align-items:Center; //竖
}
标签:css垂直居中 item ima middle items javascrip index class lin
原文地址:https://www.cnblogs.com/congxueda/p/9495475.html