论坛

标题: 作业 [打印本页]

作者: 爰昔    时间: 2016-12-14 11:24
标题: 作业


[attach]76140[/attach]<!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/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
* {
        margin: 0px;
        padding: 0px;
}

body {
        font-family: "微软雅黑", "华文细黑";
        font-size: 14px;
        font-weight: bold;
        color:#3D3753;
        line-height: 55px;
        background-color: rgba(255,255,255,1);
        background-image: url(imges/6-01.jpg);
        background-repeat: no-repeat;
        background-position: center top;
}
#menu {
        height: 55px;
        width: 642px;
        margin-right: auto;
        margin-left:auto;
        padding-top: 191px;       
}
.font01 {
        color: rgba(255,255,255,1);
}
#menu ul li {
        float: left;
        height: 55px;
        width: 107px;
        text-align: center;
        list-style-type: none;
}
</style>
</head>

<body>
<div id="menu">
<ul>
<li class="font01">网站首页</li>
<li>关于我们</li>
<li>美味体验</li>
<li>销售网络</li>
<li>我们的故事</li>
<li>联系我们</li>
</ul>
</div>
</body>
</html>



我发现老师的代码中有一个


* {
        margin: 0px;
        padding: 0px;
}


我开始没加这一段时无序列表列表的位置无法控制在div里面,而且通过div上方的边距填充,不管怎么设置,div上方都会留一段距离,后来加上这一段就好了。
可能是老师讲课时我没有注意到,请问老师这个*是表示什么呢?

作者: 潜意式    时间: 2016-12-14 18:45
这个是一个通用选择器,Dreamweaver写代码默认会有内边距和外边距数值,这个的意思就是,清除所有元素默认的内外边距。一般都会这样先设置一下。




欢迎光临 论坛 (http://bbs.qinxue.com/) Powered by Discuz! X3.1