java懂的来,css文体中的#head啥意思,#foot呢,

html-css06

java懂的来,css文体中的#head啥意思,#foot呢,,第1张

加#号的是用ID来引用的CSS样式。

你的源文件下面一定有一个ID为head的代码。

而body的作用范围是整个页面,也就是<body></body>这对标记里面。这个样式设置的是body的背景图片。

至于foot也只是一个名称而已。

你可以设写一个ID为foot的代码,然后用#foot来引用。

这样说,明白么?

@CHARSET "UTF-8"

body{

background-image:url('/servlet/111.JPG')

}

#head{

background-color:#ccdd11

color:blue

font-family:Comic Sans MS

font-size:200%

font-weight:粗体

position:absolutetop:100pxleft:200px

}

#foot{background-color:red}

<body>

<div id="foot">例子</div>

</body>

自己写的,希望得到分。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312" />

<title>无标题文档</title>

<!--原理很简单,给要铺满整个屏幕的div层的宽度100% 其余要居中显示的内容给一个宽度,不要超过1000,并上设置margin属性上下为0,左右为自动-->

<style type="text/css">

<!--

body{margin:0 autopadding:0font-size:12px}

.top{width:100%height:24pxbackground:#DBDBDBmargin:0 auto}

.top .font{width:900pxheight:24pxline-height:24pxtext-align:rightmargin:0 auto}

.main{width:900pxheight:500pxbackground:#5692EBmargin:0 auto}

-->

</style>

</head>

<body>

<div class="top">

<div class="font">设为首页 | 加入收藏</div>

</div>

<div class="main"></div>

</body>

</html>

利用Dreamweaver工具实现页面的居底显示。

利用Dreamweaver打开要处理的网页,切换至“代码”查看模式,选中“<Body></body>”标签部分,然后点击“属性”工具栏中的“CSS”按钮。

接着点击“居底”按钮,就会发现页面被设置为居底显示。

也可以利用插入CSS代码来实现页面的居底显示。将以下代码放置在“<head></head>”标签中:

<style type="text/css"><!--body { margin:0 autowidth:780px  '‘'’’这个改成你网页的宽度}--></style>,也可以实现页面居底显示效果。

还可以在“<body></body>”外面添加<center></center>标签来实现同样的页面居底显示效果。