首页 > 其他 > 详细

双飞翼布局

时间:2017-10-31 14:00:31      阅读:255      评论:0      收藏:0      [点我收藏+]

由玉伯前辈提出,淘宝团队最开始运用,如果把三栏布局比作一只大鸟,可以把main看成是鸟的身体,left和right则是鸟的翅膀。这个布局的实现思路是,先把最重要的身体部分放好,然后再将翅膀移动到适当的地方.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<style>
body{margin: 0px;}
.main{
    width: 100%;
    height: 198px;
    background-color: #aaa;
}
.center{
    margin-left: 198px;
    margin-right: 198px;
    float:left; 
    background-color: #fff;
}
.left{
    margin-left: -100%;
    float: left;
    width: 198px;
    height: 198px;
    background: red;
}
.right{
    margin-left:-198px;
    width: 198px;
    float: left;
    background-color: green;
}
</style>

<body>
<div class="main">
    <div class="center">html is very much! html is very much!html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much! html is very much!</div>
    <div class="left">html is very much! html is very much! </div>
    <div class="right">how old are you!how old are you!how old are you!how old are you!how old are you!how old are you!</div>
</div>

</body>

<script>

</script>
</html>

 

双飞翼布局

原文:http://www.cnblogs.com/like-dream/p/7760799.html

(1)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!