![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
css
weblini
竹笋虽然柔嫩,但它不怕重压,敢于奋斗、敢于冒尖
展开
-
用CSS使div在整个页面中(水平、垂直)都居中——万能的
<style> html,body{ height: 100%; } body{ display: flex; align-items: center; align-content: center; } div { margin:0 auto; }</style>原创 2016-03-31 16:49:02 · 4317 阅读 · 1 评论 -
CSS巧用content内容生成
(1)防止子元素的margin越界.parent:before {content: ' ';display: table;}(2)清除子元素的浮动对父元素及后续元素造成的影响.parent:after {content: ' ';display: table;clear: both;}原创 2016-03-31 16:54:01 · 360 阅读 · 0 评论