浮动练习

这是练习的浮动效果图 

浮动练习_第1张图片 

 这是HTML部分




    
    
    Document
    
    


    
1
2
3
4
5
6
8
9
11
7
10
12

这是css部分。重置代码我就不发了

.clearfix::after{
    content: '';
    display: block;
    clear: both;
}
body{
    font-size: 18px;
    color: aliceblue;
    font-weight: 700;
}
.header{
    width: auto;
    height: 100px;
    line-height: 100px;
    text-align: center;
    background-color: #008000;
}

.header .demao{
    float: left;
    width: 20%;
}
.content{
    text-align: center;
}
.content .left{
    float: left;
    width: 60%;
    height: 350px;
}
.content .left .huangse{
    height: 100px;
    line-height: 100px;
    background: #ffff00;
}
.content .left .hebai{
    height: 150px;
    line-height: 150px;
}
.content .left .hebai .lef{
    width:50%;
    float: left;
    background: #ebebeb;
}
.content .left .hebai .rig{
    width:50%;
    float: right;
    background:#000;
}
.content .left .hunse{
    line-height: 100px;
    background: #ff0000;
}
.content .right{
    float: right;
    width: 40%;
    height: 350px;
}
.content .right .qi{
    height: 200px;
    line-height: 200px;
    background-color: #9acd32;
}
.content .right .shi{
    line-height: 150px;
    background: #00ffff;
}

.shier{
    line-height: 100px;
    background-color: #0000ff;
    text-align: center;
}

 

 

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