当前第2页 返回上一页
常用属性值:
color_name 规定颜色值为颜色名称的背景颜色(比如 red)。
hex_number 规定颜色值为十六进制值的背景颜色(比如 #ff0000)。
rgb_number 规定颜色值为 rgb 代码的背景颜色(比如 rgb(255,0,0))。
transparent 默认。背景颜色为透明。
inherit 规定应该从父元素继承 background-color 属性的设置。
代码示例:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | < html >
< head >
< style type = "text/css" >
body {background-color: yellow}
h1 {background-color: #00ff00}
h2 {background-color: transparent}
p {background-color: rgb(250,0,255)}
p.no2 {background-color: gray; padding: 20px;}
</ style >
</ head >
< body >
< h1 >这是标题 1</ h1 >
< h2 >这是标题 2</ h2 >
< p >这是段落</ p >
< p class = "no2" >这个段落设置了内边距。</ p >
</ body >
</ html >
|
相关视频教程:css视频教程
以上就是css如何清除背景颜色的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
css child选择器有哪些?
css怎么禁止选中文字
css如何修改html标签的title样式?(代码示例)
css怎么隐藏文本超出部分
bootstrap 如何修改css样式
css怎样让两个div重叠
css删除线颜色怎么设置
css input怎么去掉边框
css搜索框怎么写
css怎么设置网页标题栏图标
更多相关阅读请进入《css》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » css如何清除背景颜色