上海建筑工程学院宿舍:大家帮帮忙拉 CSS的问题!!50分

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/11 02:19:04
http://zhidao.baidu.com/question/11439791.html
1楼能不能讲点中文啊?

<style>
div{color:#F00;}
.class1{background:#DDD;}
#joy{border:solid 1px #999;}
</style>
<div>标签的效果被应用</div>
<div class="class1">类和标签的效果被应用</div>
<div class="class1" id="joy">类、标签和ID的效果被应用</div>

通过这个例子应该可以理解类、标签、ID的使用了。还要多加揣测。

body{background:url(Images/1.jpg) no-repeat center center fixed;}

当然如果给所有的div或别的什么的都可以这样应用

div{background:url(Images/1.jpg) no-repeat center center fixed;}

ID:

#joy{background:url(Images/1.jpg) no-repeat center center fixed;}

都是没有问题的。