感谢您的支持,我会继续努力的!
打开微信扫一扫,即可进行扫码打赏哦
点我查看本站打赏源码!
Powered by RUNCODEX.COM,学的不仅是技术,更是梦想!!!
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>display flex 居中</title>
</head>
<body>
<div class="v-center-flex-wrapper">
<div class="v-center-flex">
<p>自适应宽高。</p>
<p>盒子-内容 溢出</p>
<p>我的第一个段落。</p>
</div>
</body>
</html>
输入 JavaScript 代码……
xxxxxxxxxx
*,div,h1,p{margin:0;}
html,body{ height: 100%;}
.v-center-flex-wrapper{
display: flex;
direction: row;
justify-content: center;
align-items: center;
background: #f06;
width: 100%;
height: 100%;
}
.v-center-flex{
background: #f69;