日期:2014-05-17 浏览次数:20682 次
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="main.aspx.cs" Inherits="main" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>Caterpillar</title> <style type="text/css"> <!-- * { margin: 0px; padding: 0px; } body { height: 100%; } #container { margin-right: auto; margin-left: auto; } #header { background-color: #003300; height: 60px; color: #FFFFFF; } #leftdiv { background-color: #99CC00; float: left; width: 200px; } #rightdiv { background-color: #666600; margin-left: 200px; } #footer { clear: both; height: 30px; color: #FFFFFF; background-color: #990000; } --> </style> </head> <body> <div id="container"> <div id="header">header</div> <div id="content"> <div id="leftdiv">leftdiv</div> <div id="rightdiv"> <p>rightdiv</p> </div> </div> <div id="footer">footer</div> </div> </body> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>Caterpillar</title> <style type="text/css"> <!-- * { margin: 0px; padding: 0px; } body { height: 100%; } #container { margin-right: auto; margin-left: auto; } #header { background-color: #003300; height: 60px; color: #FFFFFF; } #leftdiv { background-color: #99CC00; position:absolute; left:0%; right:80%; top:60px; bottom:50px; width: 200px; } #rightdiv { background-color: #666600; /* margin-left: 200px;*/ position:absolute; left:15.5%; right:0%; top:60px; bottom:50px; } #footer { clear: both; position:absolute; bottom:1px;left:1px;right:1px; height: 50px; color: #FFFFFF; background-color: #990000; } --> </style> </head> <body> <div id="container"> <div id="header">header</div> <div id="content"> <div id="leftdiv">leftdiv</div> <div id="rightdiv"> <p>rightdiv</p> </div> </div> <div id="footer">footer</div> </div> </body> </html>
------解决方案--------------------
参考:http://blog.doyoe.com/article.asp?id=135