背景图的详细设定

来源:互联网 发布:c语言最小公约数 编辑:程序博客网 时间:2024/04/29 12:42
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
ody>卷标提供了以下几种设定:
<body
alink=colorvalue
background=url
bgcolro=colorvalue
link=colorvalue
text=colorvalue
bgproperties=fixed /*背景固定
leftmargin=pixels /*离浏览器显示窗左边的距离
topmargin=fixels /*离浏览器显示窗上面的距离
>

HTML 3.2所能用的设定非常有限,但在CSS 2.0 对于<body>有更详细的设定。
对于css在<body>的设定大致有两种:

在<head></head>间定义一段CSS的类别,此类别是针对<body>定义的
<style>
body {background-image:url(n.jpg);
background-repeat:not-repeat;
}
</style>
或者是
<BODY style="background-image:url(n.jpg);background-repeat:no-repeat">
两种都是一样的功能。

CSS对于<body>卷标又更详细的定义,大致如下:
<body
color:colorvalue
/*前景颜色

background-color:colorvalue
/*背景颜色
color与background-color的设定有五种方式:
1.color:#FFFFFF
2.color:#FFF
3.color:rgb(255,255,255)
4.color:purple
5.color:rgb(100%,50%,10%)

background-image:url(n.jpg)
/*背景图

background-repeat:repeat|repeat-x|repeat-y|no-repeat
/* 重复显示全影幕|水平方向重复|垂直方向重复|不重复显示

background-attachment:scroll|fixed
/*卷动或固定

background-position:x%,y%|x,y|top|left|center|bottom|right
/*背景图文件位置
>

你也可以将HTML与CSS同时使用:
<BODY bgcolor="black" style="background-image:url(n.jpg);background-repeat:no-repeat"
topmargin="0" leftmargin="0" link="#ffffff" alink="aqua"
vlink="red" bgProperties=fixed text="#FFFFFF">

在此例中,我定义背景不会重复显示,而且背景固定不随画面卷动...
像这样的设定可以让网页的版面便的比较好看一点....
背景图也能用的更完美....

对于背景与<body>的设定大概就是这样..
如果以上的内容有误或着有问题的话..
欢迎你mail给我... <script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>