css 02-CSS属性:背景属性】的更多相关文章

样式表书写位置  内嵌式写法 <head> <style type="text/css"> 样式表写法 </style> </head> 外链式写法 写在head里,<link rel="stylesheet" href = "1.css"> 行内样式表/内联式 <h1 style = "font - size : 30px ; color : red;">…
CSS背景在网页设计中使用频率非常高,然而对于这个开发人员很熟悉的CSS属性,却隐藏着许多不为初级开发人员熟知的细节,这篇文章尝试扒开这层不为人知的面纱. 首先列举一下CSS中关于元素背景的所有属性并简要描述了其作用,其中后面几个属性是在CSS3中新加入的. 属性 描述 备注 background 简写属性,作用是将背景属性设置在一个声明中.   background-color 设置元素背景颜色   background-image 把图像设置为背景   background-repeat 设…
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的背景属性Background,包括CSS3中新增的背景属性.如果你是个CSS初学者,还可以查看之前介绍的CSS浮动属性和CSS透明属性详解. CSS2 中有5个主要的背景(background)属性,它们是: background-color: 指定填充背景的颜色. background-image: 引用图片作为背景. background-position: 指定元素背景图片的位置. background-repeat: 决定是否重复背景图片. background…
CSS背景属性 1.background-attachment 属性 scroll:默认值.背景图像会随着页面其余部分的滚动而移动. fixed:当页面的其余部分滚动时,背景图像不会移动. inherit:规定应该从父元素继承 background-attachment 属性的设置. body { background-image: url(bgimage.gif); background-attachment: fixed; } 2.background-clip 属性 border-box:…
背景颜色(background-color) CSS可以用纯色来作为背景,也可以将背景设置为透明,background相当于xhtml中的bgcolor. 它的两个值: transparent(默认值,透明) color(指定的颜色,和文本颜色的设置方法相同) 示例: body {background-color: black;} h1 {background-color: #00ff00;} h2 {background-color: transparent;} p {background-c…
[CSS常用文本属性] 1. 字体.字号类:① font-weight: 字体粗细. bold-加粗.normal-正常.lighter-细体 也可以使用100-900数值,400表示normal,700表示bold ② font-style: 字体样式. italic-倾斜.normal-正常 ③ font-size: 字号. 可以写px单位,也可以写% 200%表示浏览器默认大小(16px)的两倍=32px ④ font-family: 字体系列(字体族). >>> 可以直接写字体名…
本文最初发表于博客园,并在GitHub上持续更新前端的系列文章.欢迎在GitHub上关注我,一起入门和进阶前端. 以下是正文. background系列属性 常见背景属性 CSS样式中,常见的背景属性有以下几种:(经常用到,要记住) background-color:#ff99ff; 设置元素的背景颜色. background-image:url(images/2.gif); 将图像设置为背景. background-repeat: no-repeat; 设置背景图片是否重复及如何重复,默认平铺…
CSS的背景属性: background 简写属性,作用是将背景属性设置在一个声明中 background-attachment 背景图像是否固定或者随着页面的其余部分滚动 background-color 设置元素的背景颜色 background-image 把图像设置为背景 background-position 设置背景图像的起始位置 background-repeat 设置背景图像是否如何重复 实例代码一: <p style="background-color:pink; widt…
CSS属性 一.宽和高 width属性可以为元素设置宽度. height属性可以为元素设置高度. 块级标签才能设置宽度,内联标签的宽度由内容来决定. div {width: 1000px;background-color: red} /*块级标签设置了width会生效*/ span {width: 1000px;background-color: red} /*内联标签设置了width不生效*/ 二.字体属性 1.文字字体:font-family font-family可以把多个字体名称作为一个…