
一、可以利用flex来布局一个p在另一个p里面水平垂直居中
如:html代码:
<p> </p><p> </p>
css代码:
.container{
width:600px;
height:400px;
border:1px solid blue;
display: flex;
justify-content:center;
align-items:center;
}
.box{
width:200px;
height:100px;
border:1px red solid;
ps:这样就可以水平垂直居中咯
二、flex的属性
<p> </p><p>1</p> <p>23</p><div class="aritcle_card flexRow artxards"> <div class="artcardd flexRow"> <a class="aritcle_card_img" rel="nofollow" href="/xiazai/gongju/2905" title="CSS"><img src="https://img.php.cn/upload/manual/000/969/633/6af2b1226ad9e733.png" alt="CSS" onerror="this.onerror='';this.src='/static/lhimages/moren/morentu.png'" ></a> <div class="aritcle_card_info flexColumn"> <a rel="nofollow" href="/xiazai/gongju/2905" title="CSS" class="overflowclass">CSS</a> <p class="overflowclass">CSS 官方网站入口。访问 W3C 的 CSS 页面,查看 CSS 标准、学习资料与工作组动态;CSS 是 Web 标准,无需下载安装。</p> </div> <a rel="nofollow" href="/xiazai/gongju/2905" title="CSS" class="aritcle_card_btn flexRow flexcenter"><b></b><span>下载</span> </a> </div> </div> <p>4</p>
可以写在items上的属性有六个:
•flex-direction
•flex-wrap
•flex-flow
•justify-content
•align-items
•align-content
可以写在item上的有6个:
•order//这个就是item单独给了,要是想让那个item调换顺序就给这个属性给那个item
•flex-grow
•flex-shrink
•flex-basis
•flex
•align-self
前端入门到VUE实战笔记:立即使用
在学习笔记中,你将探索 前端 的入门与实战技巧!










