87,919
社区成员
发帖
与我相关
我的任务
分享
<!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></title>
</head>
<body>
<div style="height:300px; width:300px; background-color:#0000FF">
<div style="height:100px; width:100px;margin:0 auto; background-color:#990000"></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></title>
</head>
<body>
<div style="height:300px; width:300px; background-color:#0000FF">
<table border="0" cellpadding="0" cellspacing="0" ><tr><td width="100px"> </td><td width="100px" valign="middle">
<div style="height:100px; width:100px;margin:0 auto; background-color:#990000"></div>
</td><td width="100px"> </td></div>
</body>
</html>
align ="left"
就能靠左了
<div style="height:300px;width:300px;background-color:#0000FF; text-align:center;vertical-align:middle;position: absolute;">
<div style="height:100px;width:100px;background-color:#990000;position: absolute;top:expression((this.parentElement.offsetHeight-this.offsetHeight)/2);left:expression((this.parentElement.offsetWidth-this.offsetWidth)/2);">