慕课网企业网站综合布局实战

我用的前端开发神器WebStrom编辑的,下面是我写的部分代码,还有一些兼容没有处理,在本次的布局实战中,很多东西需要去实践才能发现问题,有的模块如果高度有变化就设置一个min-height属性,但是IE不兼容,只能使用_height。图片资源可以去http://www.imooc.com/learn/147下载

index.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>慕课实战</title>
<link rel="stylesheet" href="css/index.css" type="text/css">
<script type="text/javascript" src="js/myfocus-2.0.1.min.js"></script>
<script type="text/javascript" src="js/mf-pattern/mF_fancy.js"></script>
<link rel="stylesheet" href="js/mf-pattern/mF_fancy.css" type="text/css">
<script type="text/javascript">
myFocus.set({id: "picBox"});
</script>
</head>
<body>
<div class="top">
<div class="top_content">
<div class="top_content_left"><img src="img/logo.jpg"></div>
<div class="top_content_right">
<ul>
<li><a href="#">首页</a></li>
<li><a href="#">产品特色</a></li>
<li><a href="#">解决方案</a></li>
<li><a href="#">产品价格</a></li>
<li><a href="#">帮助中心</a></li>
<li><a href="#">关于我们</a></li>
</ul>
</div><!--top_content_right结束 !-->
</div><!--top_content结束 !-->
</div><!--top结束 !-->
<div id="wrap">
<div class="ad" id="picBox">
<div class="loading"><img src="img/loading.gif"></div>
<div class="pic">
<ul>
<li><img src="img/ad2.jpg"></li>
<li><img src="img/ad3.jpg"></li>
<li><img src="img/ad4.jpg"></li>
</ul>
</div><!--pic结束 !-->
</div><!--picBox结束 !-->
<div class="new_type">
<div class="new_type_top">
<div class=" new_type_top_left"><a href="#">新闻</a></div>
<div class=" new_type_top_right"><a href="#">这是滚动新闻</a></div>
</div><!--new_type_top结束 !-->
<div class="new_type_bottom">
<div class=" new_type_bottom_left"><img src="img/bs.jpg">
<p>玩转Bootstrap</p></div>
<div class=" new_type_bottom_middle"><img src="img/css.jpg">
<p>企业网站案例</p></div>
<div class=" new_type_bottom_right"><img src="img/js.jpg"
style="width: 324px">
<p>JavaScript基础</p></div>
</div><!--new_type_bottom结束 !-->
</div><!--new_type结束 !-->
<div class="main">
<div class="news">
<h2>新闻中心</h2>
<div class="news_list">
<ul>
<li>
<div class="date">820</div>
<div class="news_info"><h3>学习计划之"Andoid"的习惯养成</h3>
<p>Andoid哈哈哈哈哈哈你身上的机会很多很好的和事实上还是实话实说还是顶顶顶顶顶不</p>
</div>
</li>
<li>
<div class="date">423</div>
<div class="news_info"><h3>学习计划之"Andoid"</h3>
<p>Andoid哈哈哈哈哈哈你身上的机会很多很好的和事实上还是实话实说还是顶顶顶顶顶不</p>
</div>
</li>
<li>
<div class="date">524</div>
<div class="news_info"><h3>学习计划之"Andoid"的习惯养成</h3>
<p>Andoid哈哈哈哈哈哈你身上的机会很多很好的和事实上还是实话实说还是顶顶顶顶顶不</p>
</div>
</li>


</ul>
</div>
</div><!--news结束 !-->
<div class="active">
<h2>热门活动</h2>
<img src="img/2048.jpg">
<div class="active_list">
<ul>
<li>慕课网2048游戏源码征集</li>
<li>慕课网2048游戏源码征集</li>
<li>慕课网2048游戏源码征集</li>
<li>慕课网2048游戏源码征集</li>
<li>慕课网2048游戏源码征集</li>
</ul>
</div>
</div><!--active结束 !-->
<div class="concat">
<h2>联系我们</h2>
<div class="concat_list">
<div class="teacher_info">
讲师招聘<br/>
邹同学<br/>
电话:19245745<br/>
QQ:576264119<br/>
E-mail:daisy@imcooc.com<br/>
</div><!--teacher_info结束 !-->
<div class="wang_info">
网站合作<br/>
吕同学<br/>
电话:19245745<br/>
QQ:10598141<br/>
E-mail:lvyang@imcooc.com<br/>
</div><!--wang_info结束 !-->
</div>
</div><!--concat结束 !-->
</div>
</div><!--wrap结束 !-->
<div class="footer">
Copyright@2017 By chenli
</div><!--footer结束 !-->
</body>
</html>

index.css
body,ul, h2, li, a, h2,h3 {
margin: 0;
padding: 0;
font-size: 12px;
border: none;
}



.top {
width: 100%;
}

.top_content {
background: white;
width: 1000px;
margin: 0 auto;
height: 70px;

}

.top_content_left {
width: 220px;
float: left;
margin: 0 auto;

}

.top_content_right {
float: left;
width: 760px;
}

.top_content_right li {
list-style: none;
width: 100px;
height: 70px;
line-height: 70px;
float: left;

}

.top_content_right a:link, .top_content_right a:visited {
text-decoration: none;
color: black;
font-size: 14px;
display: block;
text-align: center;

}

.top_content_right a:hover, .top_content_right a:active {
background: firebrick;
}

.ad {
margin: 0 auto;
width: 1000px;
height: 350px;
overflow: hidden;
}

.new_type {
width: 1000px;
margin: 10px auto;

}

.new_type_top {
height: 40px;
margin: 0 auto;
}

.new_type_top_left {
width: 10%;
background: firebrick;
float: left;
line-height: 40px;
text-align: center;

}

.new_type_top_right {
height: 40px;
float: left;
width: 89%;
background: dimgrey;
line-height: 40px;
padding-left: 10px;

}

.new_type_top a {
text-decoration: none;
font-size: 14px;
color: white;
}

.new_type_bottom {
width: 1000px;
margin-top: 10px;
clear: both;
height: 160px;

}

.new_type_bottom_left {
width: 330px;
float: left;
}

.new_type_bottom_middle {
width: 330px;
margin: 0 5px;
float: left;
}

.new_type_bottom_right {
width: 324px;
float: right;
}

.new_type_bottom p {
font-size: 14px;
color: black;
font-weight: bold;
text-align: center;
border: 1px solid #E8E8E8;
}

.main {
_height: 302px;
min-height:302px;
width: 1000px;
margin: 0 auto;
}

.main h2 {
height: 40px;
line-height: 40px;
font-size: 14px;
padding-left: 10px;
background: firebrick;
}

.news, .active, .concat {
border: 1px solid #E8E8E8;
float: left;
}

.news {
width: 330px;
min-height: 300px;
_height: 300px;

}

.news_list {
width: 300px;
margin-top: 10px;

}

.news_list li {
width: 310px;
list-style: none;
border-bottom: 1px solid #E8E8E8;
height:61px;
float: left;
padding: 10px;

}
.news_list li:last-child {
border-bottom: none;
}
.date {
width: 30px;
height: 40px;
padding: 5px;
line-height: 20px;
color: white;
border-radius: 4px;
background: firebrick;
float: left;

}

.date h3 {

font-size: 14px;
font-weight: bold;
}

.date p {
margin-top: 10px;
height: 340px;
line-height:40px;

}

.news_info {
width: 260px;
float: right;
}

.active {
width: 330px;
margin: 0 5px;
min-height: 300px;
_height: 300px;
}

.active img {
height: 100px;
width: 310px;
padding: 10px 10px 0;

}

.active li {
padding-left: 10px;
list-style: none;
height: 25px;
line-height: 25px;
font-weight: bold;
font-size: 14px;
}
.active li:first-child {
margin-top: 10px;
}
.concat {
width: 324px;
min-height: 300px;
_height: 300px;

}

.teacher_info, .wang_info {
line-height: 22px;
font-size: 16px;
font-weight: bold;
color: black;
padding-bottom: 14px;
}

.teacher_info {
padding-top: 10px;
}

.footer {
clear: left;
width: 1000px;
background: #E8E8E8;
text-align: center;
height: 40px;
font-size: 16px;
line-height: 40px;
margin: 20px auto 0;
}

   图片资源



body,ul, h2, li, a, h2,h3 {
margin: 0;
padding: 0;
font-size: 12px;
border: none;
}



.top {
width: 100%;
}

.top_content {
background: white;
width: 1000px;
margin: 0 auto;
height: 70px;

}

.top_content_left {
width: 220px;
float: left;
margin: 0 auto;

}

.top_content_right {
float: left;
width: 760px;
}

.top_content_right li {
list-style: none;
width: 100px;
height: 70px;
line-height: 70px;
float: left;

}

.top_content_right a:link, .top_content_right a:visited {
text-decoration: none;
color: black;
font-size: 14px;
display: block;
text-align: center;

}

.top_content_right a:hover, .top_content_right a:active {
background: firebrick;
}

.ad {
margin: 0 auto;
width: 1000px;
height: 350px;
overflow: hidden;
}

.new_type {
width: 1000px;
margin: 10px auto;

}

.new_type_top {
height: 40px;
margin: 0 auto;
}

.new_type_top_left {
width: 10%;
background: firebrick;
float: left;
line-height: 40px;
text-align: center;

}

.new_type_top_right {
height: 40px;
float: left;
width: 89%;
background: dimgrey;
line-height: 40px;
padding-left: 10px;

}

.new_type_top a {
text-decoration: none;
font-size: 14px;
color: white;
}

.new_type_bottom {
width: 1000px;
margin-top: 10px;
clear: both;
height: 160px;

}

.new_type_bottom_left {
width: 330px;
float: left;
}

.new_type_bottom_middle {
width: 330px;
margin: 0 5px;
float: left;
}

.new_type_bottom_right {
width: 324px;
float: right;
}

.new_type_bottom p {
font-size: 14px;
color: black;
font-weight: bold;
text-align: center;
border: 1px solid #E8E8E8;
}

.main {
_height: 302px;
min-height:302px;
width: 1000px;
margin: 0 auto;
}

.main h2 {
height: 40px;
line-height: 40px;
font-size: 14px;
padding-left: 10px;
background: firebrick;
}

.news, .active, .concat {
border: 1px solid #E8E8E8;
float: left;
}

.news {
width: 330px;
min-height: 300px;
_height: 300px;

}

.news_list {
width: 300px;
margin-top: 10px;

}

.news_list li {
width: 310px;
list-style: none;
border-bottom: 1px solid #E8E8E8;
height:61px;
float: left;
padding: 10px;

}
.news_list li:last-child {
border-bottom: none;
}
.date {
width: 30px;
height: 40px;
padding: 5px;
line-height: 20px;
color: white;
border-radius: 4px;
background: firebrick;
float: left;

}

.date h3 {

font-size: 14px;
font-weight: bold;
}

.date p {
margin-top: 10px;
height: 340px;
line-height:40px;

}

.news_info {
width: 260px;
float: right;
}

.active {
width: 330px;
margin: 0 5px;
min-height: 300px;
_height: 300px;
}

.active img {
height: 100px;
width: 310px;
padding: 10px 10px 0;

}

.active li {
padding-left: 10px;
list-style: none;
height: 25px;
line-height: 25px;
font-weight: bold;
font-size: 14px;
}
.active li:first-child {
margin-top: 10px;
}
.concat {
width: 324px;
min-height: 300px;
_height: 300px;

}

.teacher_info, .wang_info {
line-height: 22px;
font-size: 16px;
font-weight: bold;
color: black;
padding-bottom: 14px;
}

.teacher_info {
padding-top: 10px;
}

.footer {
clear: left;
width: 1000px;
background: #E8E8E8;
text-align: center;
height: 40px;
font-size: 16px;
line-height: 40px;
margin: 20px auto 0;
}

转载于:https://www.cnblogs.com/Candicecl/p/7504535.html

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值