网站建设与设计:设置对象的文本颜色
清除( clear)
语法:clear:none l left lright I both
参数:none允许两边都可以有浮动对象,both不允许有浮动对象,left不允许左边有浮功对象,right不允许右边有浮动对象。
说明:该属性的值指出了不允许有浮动对象的边。
示例:如果想使一段文字包裹某一对象,而下一段文字不包裹,可以使用clear属性。
p{ clear: left)
6.6.5背景属性
1.颜色( color)
语法:color:color
参数:color指定颜色。请参阅颜色单位。
说明:设置对象的文本颜色,即设定对象的前景颜色。用颜色名称指定的颜色可能不会
被一些浏览器接受。
示例:
div {color: #345456}
div{ color: rgb(100,14,200))
div {color: menu)
div {color: red}
b f color: #333399)严将所有的加重字以设定的颜色显示+/
b{ color: rgb(51,204,0))
2.背景色( background-color)
语法:background-color:color l transparent
参数:color指定颜色,请参阅颜色单位。transparent表示背景色透明。
说明:用于设置对象的背景颜色,即设定对象后面固定的颜色。
示例:
p{ background-color: silver)
div{ background-color: rgb(223,71,177))
body{ background-color: #98ab6f)
pre{ background-color: transparent)
p.yellow{ background-color: #ffff66}
背景图像( background-image)
code{ background-image: url("comet.jpg"))
blockquote{ backgrourid-image: url("C:klnetPub\MyPics\comet.jpg"))
br{ background-image: url(http://Fred.corrUImageFile/q.gif))
body{ background-image: none)
b{ background-image: url(background.gif))
当设定一个背景图像时,最好能指定一种背景色,这样在下载背景图像时,背景色会党
出现在屏幕上,而且它将透过背景图像上的透明区域显示出来。 {
控制背景图像的属性
不仅可以将图像放在对象后面,还可以精确地控制背景图像的各项设置。可以决定是
平铺及如何平铺,背景图像是滚动还是保持固定,以及将其放在什么位置。
(1)背景重复(background-repeat)
{吾法:background-repeat:repeat I no-repeat I repeat-x I repeat-y j
参数:repeat表示背景图像在纵向和横向上平铺,no-repeat表示背景图像不平铺,repeat-x'lI
表示背景图像在横向上平铺,repeat-y表示背景图像在纵向上平铺。 .
说明:用于设置对象的背景图像是否平铺以及如何平铺。注意,必须先指定对象的背景
图像。
示例:
p{ background: url(”images/aardvark.gif’); background-repeat: no-repeat)
menu{ background: url(”images/aardvark.gif'); background-repeat: repeat-y;)
本文地址:
http://www.yishenzhou.com/yes/post/396.html | 分类:企业网站设计 |
次阅读