CSS 温故而知新 background常用属性】的更多相关文章

1.background-repeat 不用说,常用直接no-repeat 2.background-size 常用的分为两个,一个是铺满:cover, 另一个是使图像适应宽高:contain 3.background-position 设置图片所处的位置:left/right/bottom/top/center…
css中background背景属性概 background:url(背景图片路径)  no-repeat;/*不重复默认在左上方*/background:url(背景图片路径)  no-repeat center;/*不重复背景图片中间显示*/background:url(背景图片路径)  no-repeat bottom center;/*不重复背景图片底部中间显示*/background:url(背景图片路径)  no-repeat right top;/*不重复背景图片右上方显示*/ba…
前端CSS-font属性,超链接的美化,css精灵,background综合属性 1. font属性 使用font属性,能够将字号.行高.字体,能够一起设置. font:14px/24px "Times New Roman","Microsoft YaHei","SimSun"; 等价于三行语句: font-size:14px; line-height:24px; font-family:"Times New Roman",&…
一 CSS文字属性:color : #999999; /*文字颜色*/font-family : 宋体,sans-serif; /*文字字体*/font-size : 9pt; /*文字大小*/font-style:itelic; /*文字斜体*/font-variant:small-caps; /*小字体*/letter-spacing : 1pt; /*字间距离*/line-height : 200%; /*设置行高*/font-weight:bold; /*文字粗体*/vertical-a…
字体样式属性 font-size:字号大小 font-size属性用于设置字号,该属性的值可以使用相对长度单位,也可以使用绝对长度单位.其中,相对长度单位比较常用,推荐使用像素单位px,绝对长度单位使用较少. 绝对单位可选参数值:xx-small | x-small | small | medium | large | x-large | xx-large|smaller | larger <!DOCTYPE html> <html lang="en"> <…
background-image:url('图片位置');//设置背景图片的位置 background-repeat:no-repeat;//图片是否重复显示(不重复) background-position: x% y%;图片的起始位置(如果图片是需要重复显示):如果不需要重复显示可以通过该项设置图片的位置 background-size: size1 size2;//图片的大小 比如要做一个物流信息追踪的图,可以用list-style-image属性加上负的margin值来实现:…
background:url(背景图片路径) no-repeat;/*不重复默认在左上方*/ background:url(背景图片路径) no-repeat center;/*不重复背景图片中间显示*/ background:url(背景图片路径) no-repeat bottom center;/*不重复背景图片底部中间显示*/ background:url(背景图片路径) no-repeat right top;/*不重复背景图片右上方显示*/ background:url(背景图片路径)…
前言:这段时间天天加班到10:30之后,简直是x了. 在上一篇文章中,分别解析了background各个属性的用法和注意细节.如果我们在项目上使用背景效果,如果使用下面的写法,你可能抓狂. body{background-color:#ccc;background-image:url(bg123.gif);background-repeat:no-repeat;background-position:50% 50%;} 这样就会得到自己想要的背景效果,但是如果每次都这么写,那就太坑爹了,其实ba…
web工程师是最近5年刚刚兴起的一门高薪职业,人们的专注度越来越高. 那么前端除了学习html标签之外还需要掌握什么知识点呢? 为大家整理了一个和HTML标签密不可分的知识要点--<CSS样式常用属性> ******* CSS 常用属性 ********* z-index: auto (默认值) 检索或设置对象的层叠顺序. 并级的对象,此属性参数值越大,则被层叠在最上面. 如两个对象的此属性具有同样的值,那么将依据它们在HTML文档中流的顺序层叠,写在后面的将会覆盖前面的. 必须定义posit…
好程序员web前端分享css常用属性缩写,使用缩写可以帮助减少你CSS文件的大小,更加容易阅读.css缩写的主要规则如下: 颜色 16进制的色彩值,如果每两位的值相同,可以缩写一半,例如: #000000可以缩写为#000;#336699可以缩写为#369; 盒尺寸 通常有下面四种书写方法: property:value1; 表示所有边都是一个值value1; property:value1 value2; 表示top和bottom的值是value1,right和left的值是value2 pr…