HTML+CSS基础综合案例

1.尚合综合案例

学完盒子模型,浮动之后,从技术层面上,已经可以完成一个简单的页面案例了,我们来看一下如下案例。

        效果图

​​​​​​HTML+CSS基础综合案例_第1张图片

HTML代码如下: 



  
    
    
    
    Document
    
  
  
    
    
    
    
  

css代码如下:

 

*{
  margin: 0;
  padding: 0;
}
a{
  text-decoration: none;
}
li{
  list-style: none;
}
.header{
  background-color: #fff;
}
.w{
  width: 980px;
  margin: 0 auto;
}
.h-top{
  height:40px;
  padding-top: 20px;
  padding-bottom: 10px;
}
.h-top img{
  display: inline-block;
  background-color: #fff;
}
.h-right{
  float: right;
  padding-right: 10px;
}
.nav{
  position: relative;
  width: 100%;
  height: 55px;
  background-color: #ebebeb;
  border: 1px solid #ccc;
  background-image: url(../images/nav_bg.png);
}
.nav li{
  display: inline-block;
  text-align: center;
  width: 130px;
  height: 55px;
  line-height: 55px;
  border-right: 1px solid #ccc;
}
.nav li a{
  color: #000;
}
.content{
  line-height: 30px;
  font-size: 10px;
}
.c-bac{
  background-color: #fbfbfb;
  border: 1px solid #efefef;
}
.c-top span{
  font-weight: 700;
}
.c-right{
  float: right;
  padding-top: 5px;
}
.c-bottom{
  margin-top: 15px;
  height: 224px;
  margin-bottom: 50px;
}
.c-b-left{
  float: left;
  width: 310px;
  height: 224px;
  border: 1px solid #efefef;
  box-sizing: border-box;
}
.c-b-box{
  width: 310px;
  height: 194px;
}
.c-b-left .shouji{
  padding-bottom: 50px;
}
.c-b-left .icon{
  padding: 50px 40px 100px 20px;
}

.c-bottom p{
  box-sizing: border-box;
  height: 30px;
  padding: 5px;
  color: #7ab800;
  font-weight: 700;
  font-size: 12px;
}
.c-bottom  span{
  margin-left: 5px;
}
.c-b-center{
  float: left;
  height: 224px;
  border: 1px solid #efefef;
  width: 375px;
  margin-left: 12px;
  box-sizing: border-box;
}
.c-bottom li{
  box-sizing: border-box;
  width: 100%;
  height: 28px;
  line-height: 28px;
  border-bottom: 1px dashed #dcdcdc;
  margin-left: 20px;
}
.c-b-center li:first-child a{
  color: #f00;
  font-weight: 700;
}
.c-bottom li a{
  font-size: 12px;
  color: #666;  
}

.c-b-right{
  float: right;
  border: 1px solid #efefef;
  width: 270px;
  height: 224px;
  box-sizing: border-box;
}
.shouhou li{
  border: none;
  padding-left: 5px;
  height: 20px;
}
.shouhou li a{
  border-left:3px solid #7ab800;
  padding-left: 3px;
}
.shouhou li:nth-child(5){
  margin-top: 35px;
}
.shouhou li:nth-child(n+5) a{
  border: none;
}
.footer{
  /* height: 305px; */
  background-color: #2d2d2d;
}
.f-table{
  margin-bottom:50px ;
  overflow: hidden;
}
.f-table table{
  float: left;
  width: 900px;
}
.f-top{
  float: right;
  margin-right: 5px;
}
.f-table th{
  width: 110px;
  font-size: 12px;
  text-align: left;
  padding: 15px;
  color: #c7c7c7;
  box-sizing: border-box;
}
.f-table td{
  width: 110px;
  color: #707070;
  font-size: 12px;
  text-align: left;
  padding-left: 15px;
  box-sizing: border-box;
}
.f-copy{
  border-top: 1px dashed #414141;
  text-align: center;
  font-size: 12px;
  color: #000;
}
.f-copy p{
  margin: 10px 0;
}

成果图: 

HTML+CSS基础综合案例_第2张图片

 

 2.腾讯云综合案例

        效果图

HTML+CSS基础综合案例_第3张图片

html代码如下:

 



  
    
    
    
    腾讯云
    
  
  
    
    
    
    
    
    

云从业者培训及认证

好好学习,天天向上

在线课程

本课程专为云计算初学者、学生、个人开发者打造,购买云+校园任意套餐可免费观看课程视频本课程专为云计算初学者、学生、个人开发者打造,购买云+校园任意套餐可免费观看课程视频本课程专为云计算初学者、学生、个人开发者打造,购买云+校园任意套餐可免费观看课程视频本课程专为云计算初学者、学生、个人开发者打造,购买云+校园任意套餐可免费观看课程视频本课程专为云计算初学者、学生、个人开发者打造,购买云+校园任意套餐可免费观看课程视频

css代码如下:

*{
  margin: 0;
  padding: 0;
}
li{
  list-style: none;
}
a{
  text-decoration: none;
  color: #fff;
}
.header{
  height: 40px;
  background-color: #2b303b;
}
.w{
  margin: 0 auto;
  width: 1200px;
}
.h-top{
  height: 40px;
  line-height: 40px;
  color: #fff;
}
.h-top h3{
  float: left;
}
.h-top h3::after{
  background-image: url(../images/logo.png);
}
.h-top ul{
  float: right;
}
.h-top li{
  float: left;
  
  height: 40px;
 
}
.h-top a{
  padding: 0 8px;
  font-size: 14px;
  border-right: 1px solid #fff;
}
.h-top li:last-child a{
  border: 0;
}
.list{
  background-color: #181c28;
}
.banner{
  height: 480px;
  background-image: url(../images/banner.png);
}
.banner ul{
  width: 230px;
  background-color: #1a2b3f;
  padding-top: 40px;
}
.banner li{
  padding: 0 20px;
  height: 40px;
  line-height: 40px;
}

.banner li span{
  float: right;
  color: #fff;
}
.leran h2{
  text-align: center;
  font-weight: normal;
  margin-top: 30px;
  margin-bottom: 20px;
}
.leran p{
  text-align: center;
  margin-bottom: 30px;
  font-size: 16px;
}
.kecheng{
  width: 1200px;
  height: 460px;
  border: 1px solid #ccc;
  text-align: center;
  padding: 40px 50px 70px 40px;
  box-sizing: border-box;
}
.k-left{
  float: left;
  width: 450px;
  height: 350px;
}
.k-left h3{
  font-size: 26px;
  width: 110px;
  line-height: 40px;
  font-weight: normal;
  text-align: left;
  border-bottom: 1px solid #ccc;
}
.k-left p{
  padding-top: 20px;
  line-height: 30px;
  text-align: left;
  font-size: 12px;
  color: #666;
}
.k-left button{
  float: left;
  width: 160px;
  height: 45px;
  border: 2px solid #ffa500;
  background-color: #fff;
}
.k-right{
  float: left;
  width: 580px;
}
.clearfix::after{
  content: "";
  display: block;
  clear: both;
}
.k-right img{
  width: 100%;
}
.footer{
  margin-top:135px ;
  height: 350px;
  background-color: #2e3033;
}
.f-left ul{
  float: left;
  width: 200px;
  padding-top: 20px;
}

.f-left ul li:first-child{
  margin-bottom: 10px;
}
.f-left ul li:first-child a{
  font-weight: 700;
  font-size: 16px;
}
.f-left a{
  font-size: 12px;
  color: #eee;
}
.f-right{
  float: right;
  width: 190px;
  margin-top: 20px;
  color: #eee;
  font-size: 12px;
}
.f-right p{
  line-height: 20px;
}
.f-right p:last-child{
  margin-top: 20px;
  width: 190px;
  height: 35px;
  line-height: 35px;
  text-align: center;
  background-color: #00a4ff;
  color:#fff;
}

成果图如下:

HTML+CSS基础综合案例_第4张图片

 

你可能感兴趣的:(html,css,前端)