请老师帮忙看下代码是否正确
来源:2-7 编程练习
最后的魔法使
2019-07-04 11:35:56
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
/*此处写代码*/
* {padding: 0;margin: 0;}
a {text-decoration: none;}
.mooc, .foot {
width: 100%;
height: 100px;
background-color: black;
line-height: 100px;
overflow: hidden;
zoom:1;
}
.img {
float: left;
height: 100px;
}
.nav {
float: right;
}
ul li {
display: inline;
margin: 30px;
color: white;
font: 25px '微软雅黑';
}
.nav ul li:nth-child(5) {
padding-right: 10px;
}
.foot ul {
width: 1000px;
margin: 0 auto;
}
.page1 {
width: 100%;
height: 372px;
background: url(http://climg.mukewang.com/58c0eda50001e12416000480.jpg) no-repeat top center;
margin-top: 100px;
}
.page2 {
width: 100%;
height: 372px;
background: url(http://climg.mukewang.com/58c0edb80001c9f216000480.jpg) no-repeat top center;
}
.page3 {
width: 100%;
height: 372px;
background: url(http://climg.mukewang.com/58c0edc9000100d516000480.jpg) no-repeat top center;
margin-bottom: 100px;
}
.mooc {
position: fixed;
top: 0;
}
.foot {
position: fixed;
bottom: 0;
}
</style>
</head>
<body>
<!-- 此处写代码 -->
<div class="mooc">
<div class="img"><a href="#" title="img"><img src="http://climg.mukewang.com/58c0d2d900016ce303000100.png" alt="mooc"></a></div>
<div class="nav">
<a href="#" title="nav">
<ul>
<li>课程</li>
<li>职业路径</li>
<li>实战</li>
<li>猿问</li>
<li>手记</li>
</ul>
</a>
</div>
</div>
<div class="main">
<div class="page1"></div>
<div class="page2"></div>
<div class="page3"></div>
</div>
<div class="foot">
<ul>
<li>网站首页</li>
<li>企业合作</li>
<li>人才招聘</li>
<li>联系我们</li>
<li>常见问题</li>
<li>友情链接</li>
</ul>
</div>
</body>
</html>
1回答
同学你好~
代码效果实现的是可以的。可以优化下,给背景图片设置宽度100%使图片全屏显示

如果帮助到了你 欢迎采纳 祝学习愉快~
相似问题