css 代码
- @charset "utf-8" ;
- body {
- padding: 0px;
- margin: 0px;
- font-size: 12px;
- line-height: 16px;
- TEXT-ALIGN: center;
- }
- #header{
- /*float: left;*/
- clear: both;
- border:1px solid #000;
- text-align: center;
- margin-top: 2px;
- margin-right: auto;
- margin-left: auto;
- width : 800;
- height:100px;
- }
- #footer {
- clear: both;
- border:1px solid #000;
- text-align: center;
- width: 800;
- margin: 3;
- margin-right: auto;
- margin-left: auto;
- font-size: 12px;
- color: #999999;
- }
- /* 这个让元素居中*/
- #container {
- position:relative;
- width: 812px;
- height: 800px;
- border:1px solid #000;
- margin-right: auto;
- margin-left: auto;
- TEXT-ALIGN: center;
- }
- #left {
- border:1px solid #000;
- float: left;
- width: 150px;
- margin: 3px;
- margin-right: auto;
- margin-left: 3px;
- background-color: red;
- }
- #right {
- border:1px solid #000;
- float: rightright;
- width: 150px;
- margin-top: 3px;
- margin-right: 3px;
- margin-left: auto;
- background-color: green;
- }
- #middle {
- width: 490;
- border:1px solid #000;
- padding: 0px 160px 5px 160px;
- margin-top: 3px;
- margin-right: auto;
- margin-left: auto;
- background-color: silver;
- }
页面
html 代码
- <DIV id="container">
- <c:import url="/jsp/web/include/head.jsp">c:import>
- <DIV id="left" align="center">Port side text...
- <BR/><A name="ll" href="jsp/web/include/juzhong.jsp"> juzhong A>g
- <BR/>
- <BR/>
- <BR/>
- <BR/>
- <BR/>
- <BR/>
- DIV>
- <DIV id="right" align="center">
- Starboard side text...
- DIV><DIV id="middle" align="center">
- Middle column text...
- DIV>
- <c:import url="/jsp/web/include/footer.jsp">c:import>
- div>