老师麻烦帮忙检查一下代码 谢谢~
来源:2-12 编程练习
慕粉2243585596
2020-04-26 20:38:47
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
/*此处写代码*/
*{
margin:0;
padding:0;
color:#fff;
font-family: "微软雅黑";
list-style: none;
font-size: 20px;
}
.header{
width:100%;
height:100px;
background:#000;
position:fixed;
}
.logo{
background: url(http://climg.mukewang.com/58c0d2d900016ce303000100.png)no-repeat;
width: 300px;
height: 100%;
float: left;
}
.nav{
float: right;
}
.nav_ul li{
float: left;
margin-right: 60px;
line-height: 100px;
}
.content{
padding-top:100px;
/*padding-bottom:100px;*/
background:#afe6e8;
height: 500px;
}
.content_left,.content_center{
width: 35%;
float: left;
}
.left_text{
margin-left: 150px;
margin-top: 60px;
}
.center_text{
margin-top: 60px;
margin-left: 100px;
}
h3,p,span{
text-align: left;
color: #333;
}
h3{
height: 30px;
}
span{
font-size: 12px;
background: pink;
}
p{
font-size: 12px;
height: 30px;
line-height: 30px;
}
.content_right{
border-left: 5px solid #e28989;
float: right;
box-sizing: border-box;
height: 100%;
width: 30%;
}
.right_login{
margin-top: 60px;
margin-left: 60px;
}
.content_right input{
width: 200px;
height: 25px;
text-align: left;
font-size: 10px;
color: #ccc;
display: block;
margin-top:10px;
}
.content_right input:nth-child(3){
margin-top:15px;
}
.content_right input:nth-child(4){
background: red;
text-align: center;
border: none;
height: 35px;
font-size: 16px;
width: 204px;
margin-top:15px;
color: #fff;
}
.footer{
width: 100%;
position: fixed;
background:#000;
bottom: 0;
}
.footer_ul{
display:table;
margin: 0 auto;
}
.footer_ul li{
float: left;
line-height: 100px;
padding: 0px 45px;
}
</style>
</head>
<body>
<!-- 此处写代码 -->
<div class="header">
<div class="logo"></div>
<div class="nav">
<ul class=nav_ul>
<li>课程</li>
<li>职业路径</li>
<li>实战</li>
<li>猿问</li>
<li>手记</li>
</ul>
</div>
</div>
<div class="content">
<div class="content_left">
<div class="left_text">
<h3>课程推荐</h3>
<p><span>职业路径</span> HTML5与CSS3实现动态网页</p>
<p><span>职业路径</span> 零基础入门Android语法与界面</p>
<p><span>职业路径</span> iOS基础语法与常用控件</p>
<p><span>职业路径</span> PHP入门开发</p>
<p><span>职业路径</span> JAVA入门开发</p>
</div>
</div>
<div class="content_center">
<div class="center_text">
<h3>相关课程</h3>
<p>HTML CSS JavaScript</p>
<p>HTML5 CSS3 Jquery</p>
<p>移动端基础 移动端APP开发</p>
</div>
</div>
<div class="content_right">
<form class="right_login">
<h3>登录</h3>
<input type="text" placeholder="请输入登录邮箱/手机号" />
<input type="password" placeholder="6-16位密码,区分大小写,不能用空格" />
<input type="button" value="登录" />
</form>
</div>
</div>
<div class="footer">
<div class="footer_div">
<ul class=footer_ul>
<li>网站首页</li>
<li>企业合作</li>
<li>人才招聘</li>
<li>联系我们</li>
<li>常见问题</li>
<li>友情链接</li>
</ul>
</div>
</div>
</body>
</html>
1回答
好帮手慕星星
2020-04-27
同学你好,代码整体布局以及实现效果是可以的。
建议优化:
1、中间右侧输入框宽度建议设置大一些,有的提示信息没有全部显示出来

自己进行调整即可。
2、顶部和底部不需要设置固定定位,在文档流中正常排列就好,否则中间和底部会有大块间隙

参考



如果我的回答帮助到了你,欢迎采纳,祝学习愉快~
相似问题
回答 1
回答 1
回答 1
回答 1
回答 2