- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
- <title></title>
- <style type="text/css">
- * {
- margin: 0;
- padding: 0
- }
-
- /* #autoMarginBox{
- margin: 0 auto;
- width: 400px; height: 300px;
- border: 1px solid #8a2be2;
- }
- #absoluteBox{
- position: relative;
- width: 400px; height: 300px;
- border: 1px solid #eaeaea;
- margin-top: -402px;
- left:50%;margin-left: -201px;
- }*/
- #myBox {
- width: 840px;
- border: 1px solid #ff4500;
- float: left; /*高度自適應*/
- }
-
- #div1 {
- float: left;
- border: 1px solid blue;
- width: 198px;
- height: 200px;
- margin-left: 10px;
- display: inline; /*浮動佈局空白邊相加合無素下移*/
- }
-
- #div2 {
- float: left;
- border: 1px solid blue;
- width: 198px;
- height: 200px;
- margin-left: 10px;
- display: inline;
- }
-
- #div3 {
- float: left;
- border: 1px solid blue;
- width: 198px;
- height: 200px;
- margin-left: 10px;
- display: inline;
- }
-
- #div4 {
- float: left;
- border: 1px solid blue;
- width: 198px;
- height: 200px;
- margin-left: 10px;
- display: inline;
- }
- </style>
- </head>
- <body>
- <!--<div id="autoMarginBox">autoMarginCenter
- </div>
- <div id="absoluteBox">absoluteCenter</div>-->
-
- <div id="myBox">
- <div id="div1">div1</div>
- <div id="div2">div2</div>
- <div id="div3">div3</div>
- <div id="div4">div4</div>
-
- <div style="clear:both;height: 0px;overflow:hidden;"></div>
- <div>div5</div>
- </div>
-
- </body>
- </html>