宽度固定,高度不固定的div垂直水平居中
用 flexbox 的特性:
<div class="parent">
<div class="child"></div>
</div>
.parent {
display: flex;
width: 100%;
height: 300px;
background: #cecece;
align-items: center; /* 垂直居中 */
justify-content: center; /* 水平居中 */
}
.child {
background: #000;
width: 10%;
height: 10%;
}
原文链接:https://segmentfault.com/q/1010000005898631
nginx资源404 nginx无法访问静态资源 Mac nginx PHP安装Imagick Imagick 多版本PHP环境安装Imagick SSL免费续签 SSL证书续签 SSL证书领取 SSL免费 SSL证书 link must be in js secure domain list uniapp分享 wx.config is not a function 微信分享 pyenv-virtualenv brew install pyenv-virtualenv ModuleNotFoundError: No module named 'requests' python报错 python环境