[css layout][04] three percentage columns

1.我猜作者肯定这样弄的

 1 #wrapper {
 2   width: 100%;
 3   float: left;
 4 }
 5 #content {
 6   margin-right: 50%;
 7 }
 8 #navigation {
 9   float: left;
10   width: 25%;
11   margin-left: -25%;
12 }
13 #extra {
14   float: left;
15   width: 25%;
16   margin-left: -50%;
17 }
18 #footer {
19   clear: both;
20 }

果然..

2.float向右

 1 #wrapper {
 2   width: 100%;
 3   float: right;
 4 }
 5 #content {
 6   margin-right: 50%;
 7 }
 8 #navigation {
 9   float: right;
10   width: 25%;
11   margin-right: -100%;
12 }
13 #extra {
14   float: right;
15   width: 25%;
16   margin-right: -75%;
17 }
18 #footer {
19   clear: both;
20 }

3.#wrapper宽度50%,全部左浮动

 1 #wrapper {
 2   width: 50%;
 3   float: left;
 4 }
 5 #navigation {
 6   float: left;
 7   width: 25%;
 8   margin-right: -25%;
 9   position: relative;
10   left: 25%;
11 }
12 #extra {
13   float: left;
14   width: 25%;
15 }
16 #footer {
17   clear: both;
18 }

4.#wrapper宽度50%全部float向右

 1 #wrapper {
 2   width: 50%;
 3   float: right;
 4   margin-left: -50%;
 5   position: relative;
 6   left: -50%;
 7 }
 8 #navigation {
 9   float: right;
10   width: 25%;
11 }
12 #extra {
13   float: right;
14   width: 25%;
15 }
16 #footer {
17   clear: both;
18 }
原文地址:https://www.cnblogs.com/qiudeqing/p/3416284.html