DIV+CSS⽹页设计常⽤布局代码
01. 单⾏⼀列
02.
03. body{margin:0px;padding:0px;text-align:center;}
04. #content{margin-left:auto;margin-right:auto;width:400px;width:370px;}
05.
06. 两⾏⼀列
c语言输出数组序号07.
08. body{margin:0px;padding:0px;text-align:center;}
09. #content-top{margin-left:auto;margin-right:auto;width:400px;width:370px;}
10. #content-end{margin-left:auto;margin-right:auto;width:400px;width:370px;}
11.
12. 三⾏⼀列
13.
14. body{margin:0px;padding:0px;text-align:center;}
15. #content-top{margin-left:auto;margin-right:auto;width:400px;width:370px;}
16.
17. #content-mid{margin-left:auto;margin-right:auto;width:400px;width:370px;}
18. #content-end{margin-left:auto;margin-right:auto;width:400px;width:370px;}
19.
20. 单⾏两列
21.
22. #bodycenter{width:700px;margin-right:auto;margin-left:auto;overflow:auto;}
23. #bodycenter#dv1{float:left;width:280px;}
24. #bodycenter#dv2{float:right;width:410px;}
25.
26. 两⾏两列
27.
28. #header{width:700px;margin-right:auto;margin-left:auto;overflow:auto;}
29. #bodycenter{width:700px;margin-right:auto;margin-left:auto;overflow:auto;}
30.
gotoschool是什么意思31.
32. #bodycenter#dv1{float:left;width:280px;}
33. #bodycenter#dv2{float:right;width:410px;}
34.
35. 三⾏两列
36.
37. #header{width:700px;margin-right:auto;margin-left:auto;}
38. #bodycenter{width:700px;margin-right:auto;margin-left:auto;}
39. #bodycenter#dv1{float:left;width:280px;}
40. #bodycenter#dv2{float:right;width:410px;}
41. #footer{width:700px;margin-right:auto;margin-left:auto;overflow:auto;}
42. //www.qpsh
43.
44. 单⾏三列绝对定位
45.
46. #left{position:absolute;top:0px;left:0px;width:120px;}
47. #middle{margin:20px190px20px190px;}
48. #right{position:absolute;top:0px;right:0px;width:120px;}
49.
50. float定位⼀
51. xhtml:
52.
53. <divid="warp"><divid="column"><divid="column1">这⾥是第⼀列</div><divid="column2">这⾥是第⼆列</div><divclass="clear"></div></div><divid="column3">这⾥是第三列
</div><divclass="clear"></div></div>
54.
55. CSS:
html个人网页完整代码div+css56.
57. #wrap{width:100%;height:auto;}
圆满的英文58. #column{float:left;width:60%;}
59. #column1{float:left;width:30%;}
60. #column2{float:right;width:30%;}
61. #column3{float:right;width:40%;}
wxpython书>噼哩噼哩污染版62. .clear{clear:both;}
63.
64. float定位⼆
65. xhtml:
66. <divid="center"class="column"><h1>Thisisthemaincontent.</h1></div><divid="left"class="column"><h2>Thisistheleftsidebar.</h2></div><divid="right"class="column">
<h2>Thisistherightsidebar.</h2></div>
67.
68. CSS:
69.
70. body{margin:0;padding-left:200px;padding-right:190px;min-width:240px;}
71. .column{position:relative;float:left;}
72. #center{width:100%;}
73. #left{width:180px;right:240px;margin-left:-100%;}
74. #right{width:130px;margin-right:-100%;}
75.
76. 两⾏三列
77. xhtml:<divid="header">这⾥是顶⾏</div><divid="warp"><divid="column"><divid="column1">这⾥是第⼀列</div><divid="column2">这⾥是第⼆列</div><divclass="clear">
</div></P><P></div><divid="column3">这⾥是第三列</div><divclass="clear"></div></div>
78.
79. CSS:
80.
81. #header{width:100%;height:auto;}
82. #wrap{width:100%;height:auto;}
83. #column{float:left;width:60%;}
84. #column1{float:left;width:30%;}
85. #column2{float:right;width:30%;}
86. #column3{float:right;width:40%;}
87. .clear{clear:both;}
88.
89. 三⾏三列
90. xhtml:
91. <divid="header">这⾥是顶⾏</div><divid="warp"><divid="column"><divid="column1">这⾥是第⼀列</div><divid="column2">这⾥是第⼆列</div><divclass="clear"></div>
</div><divid="column3">这⾥是第三列</div><divclass="clear"></div></div><divid="footer">这⾥是底部⼀⾏</div>
92.
93. CSS:
94.
95. #header{width:100%;height:auto;}
96. #wrap{width:100%;height:auto;}
97. #column{float:left;width:60%;}
98. #column1{float:left;width:30%;}
99. #column2{float:right;width:30%;}
100. #column3{float:right;width:40%;}
101. .clear{clear:both;}
102. #footer{width:100%;height:auto;}
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论