快捷导航
发新帖
返回列表
1 529
电梯直达  跳转到指定楼层

[作业] 作业

爰昔|中级会员 |勤币 211 |学币 0
发表于 2016-12-14 11:24 | 复制链接 | 打印 | 上一主题 | 下一主题


<!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上方都会留一段距离,后来加上这一段就好了。
可能是老师讲课时我没有注意到,请问老师这个*是表示什么呢?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
举报 使用道具
| 回复

共1个回复 最后回复于 2016-12-14 18:45

勤币 18146   学币 398  
沙发
发表于 2016-12-14 18:45:34 | 只看该作者
这个是一个通用选择器,Dreamweaver写代码默认会有内边距和外边距数值,这个的意思就是,清除所有元素默认的内外边距。一般都会这样先设置一下。
举报 使用道具
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表