![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
css
前端小可爱∑(´△`)
这个作者很懒,什么都没留下…
展开
-
CSS清除浮动的几种有效推荐的方法
1、父级div定义伪类:after和zoom<style type="text/css"> .div2{background:#800080;border:1px solid red;height:100px;margin-top:10px} .left{float:left;width:20%;height:200px;background:#...原创 2019-06-12 16:40:01 · 89 阅读 · 0 评论 -
box-sizing: border-box;和box-sizing:content-box 的作用
.border-box : 指的是width=padding+border+content,就是说 加入你设置一个div的宽度为100px,这100px中包括padding border 和content内容区content-box :指的是只有内容区域是width,...翻译 2019-06-13 17:06:12 · 798 阅读 · 0 评论 -
CSS 和 CSS3 background属性
CSS background属性background-color:背景颜色 #fffbackground-image:背景图片实例:background-image:url(‘paper.gif’);background-repeat:是否平铺repeat 背景图像将向垂直和水平方向重复。这是默认repeat-x 只有水平位置会重复背景图像repeat-y 只有垂直位置会重复背景图...原创 2019-06-11 14:38:48 · 211 阅读 · 0 评论 -
css文本属性
css文本属性:test-decorationh1 {text-decoration:overline;}h2 {text-decoration:line-through;}h3 {text-decoration:underline;}如下图用em设置字体大小h1 {font-size:2.5em;} /* 40px/16=2.5em /h2 {font-size:1.875em...原创 2019-06-11 17:26:12 · 137 阅读 · 0 评论 -
隐藏元素 - display:none或visibility:hidden 的区别
visibility:hidden:隐藏的元素仍需占用与未隐藏之前一样的空间。也就是说,该元素虽然被隐藏了,但仍然会影响布局。display:none :且隐藏的元素不会占用任何空间。也就是说,该元素不但被隐藏了,而且该元素原本占用的空间也会从页面布局中消失。在不同浏览器下,对 visibility: collapse 的处理方式不同:1、visibility: collapse 的上述特性...原创 2019-06-11 17:36:37 · 194 阅读 · 0 评论 -
汇总:CSS实现水平、垂直居中
1:行块元素针对行内元素,例如:span a img text input 水平居中的方法,给父元素 text-align :center;例如:在这里插入代码片<div class="parent"> <span>inline element</span></div>行内居中只需要给父元素设置 text-align: center...原创 2019-09-18 20:56:10 · 107 阅读 · 0 评论