![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
css
css基础
旭仔_
这个作者很懒,什么都没留下…
展开
-
垂直水平居中
<div class="warp"> <div class="container"></div> </div> flex布局 .warp { dispaly: flex; justify-content: center; algin-items: center; } transform + position: absolute .warp { posotion: relative; } .container { position: abs原创 2021-04-12 22:34:18 · 139 阅读 · 0 评论 -
css清除浮动
<div class="father clearfix"> <p>子元素</p> </div> overflow:hidden .clearfix { overflow: hidden; } 父元素后加div给clear:both <div class="clear"></div> .clear {clear: both} 父元素添加after伪元素 .clearfix:after { content: '';原创 2021-02-25 10:38:36 · 104 阅读 · 0 评论 -
css实现三角形
宽高为0,border设置宽度和颜色。 <div class="triangl"></div> /** 下三角 **/ /** 上边框设置颜色和宽度,左右设置透明和宽度。不设置下边框 **/ .triangl { width: 0; height: 0; border-top: 10px solid red; border-right: 10px solid transparent; border-left: 10px solid transparent; } /**原创 2021-02-24 15:40:29 · 74 阅读 · 0 评论