惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
博客园_首页
Google DeepMind News
Google DeepMind News
博客园 - Franky
The GitHub Blog
The GitHub Blog
GbyAI
GbyAI
有赞技术团队
有赞技术团队
Microsoft Azure Blog
Microsoft Azure Blog
G
Google Developers Blog
Recent Announcements
Recent Announcements
A
About on SuperTechFans
博客园 - 【当耐特】
博客园 - 三生石上(FineUI控件)
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
罗磊的独立博客
IT之家
IT之家
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
Jina AI
Jina AI
腾讯CDC
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

博客园 - 为自己加油!

测试工具备查 测试网 WEB测试资料 ViewState/Session/Caching/Cookies总结 如何删除SQL Server表中的重复行 38年一遇的双七夕,今天你怎样过情人节? asp.net中如何设置相对路径? - 为自己加油! - 博客园 如何赋值? - 为自己加油! - 博客园 如何得到网站运行虚拟目录的实际路径? Chart相关网站 The usage of thumb 每日口语(6.14) - 为自己加油! - 博客园 一句妙语 每日口语(6.12) 我为世界杯狂 每日口语(6.8) English资料网址 六十八个超级经典小故事 保护你的DLL和Code不被别人使用。
背景样式
为自己加油! · 2010-07-13 · via 博客园 - 为自己加油!

1.背景色:background-color

background-color:背景颜色属性,就像颜色属性背景颜色指定的是背景颜色。
5种定义颜色的方法:
Property Value            Description
Color:<color keyword>     设置颜色为给定的值
Color:#rrggbb             用HTML的16位进制来表示
Color:rgb(rrr,ggg,bbb)    制定RGB三种颜色的数值(0-255)
Color:rgb(rrr%,ggg%,bbb%) 通过RGB三种颜色的百分比指定
Color:inherit             继承父值

2.背景图片:background-image

在Css中,你可以对任何元素指定背景图片,规则如下:
   Property               Value
background-image: url("<location>")
background-image: none
background-image: inherit

3.背景重复:
你可以对背景显示的方式进行微调,通过background-repeat属性,你可以指定背景的重复方式。
下面的规则是在说背景图片不允许重复:
.body
{
 background-image: url(Images/title.jpg);
 background-repeat:no-repeat;
}
如果不指定background-repeat:no-repeat,默认情况下是允许重复的。

下面是不同的选择规则:
            Property  Value
 background-repeat:  repeat
 background-repeat:  repeat-x
 background-repeat:  repeat-y
 background-repeat:  no-repeat
 background-repeat:  inherit

4.背景附着:background-attachment

这个background-attachment属性可以控制背景是否随网页滚动。
以下为几个常见值:
         Property     Value
background-attachment:scroll;
background-attachment:fixed;
background-attachment:inherit;

5.背景定位:background-position

背景定位属性用来指定背景图片在网页的展示位置。比如:
body
{
background-image: url(Images/title.jpg);
background-position: 10% 10%;
}
规则很简单
            Property  Value                     Notes
background-position: <x><y>                   用具体数值或者百分比指定
background-position: [top \center\ bottom]    用关键字定位
                                [left \ center\ right]