6.FF1.5测试通过,绝对定位,直接定位上下左右,强制边局实现容器相对大小(标准):
代码:略
7.ff1.5 IE5 IE6通过测试
HTML代码
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "//www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
html xmlns="//www.w3.org/1999/xhtml"
head
meta http-equiv="Content-Type" content="text/html; charset=utf-8" /
titleVertical centering in valid a class="channel_keylink" href="http://webdesign.chinaitlab.com/List_1367.html" target="_blank"CSS/a/title
style type="text/css"
body {padding: 0; margin: 0; font-size: 75%; line-height: 140%; font-family:Arial, Helvetica, sans-serif;}
body,html{height: 100%; }
a{color: #333;}
a:hover{color: green;}
#outer {height: 100%; overflow: hidden; position: relative;width: 100%; background:ivory; }
#outer[id] {display: table; position: static;}
#middle {position: absolute; top: 50%;text-align:center;} /* for explorer only*/
#middle[id] {display: table-cell; vertical-align: middle; position: static;}
#inner {position: relative; top: -50%;width: 600px;margin: 0 auto;text-align:left;}/*for explorer only */
div.greenBorder {border: 1px solid green; background-color: #FFF;}
p{margin: 1em;}
/style
/head
body
div id="outer"
div id="middle"
div id="inner" class="greenBorder"
pa href="javascript:toggleContent('inner',1)"默认长度/a a href="javascript:toggleContent('inner',2)"加长页面/a/p
p
1.打开illustrator,新建一个文件,画个矩形,比你要导入的图片大一些,白色填充。
/p
/div
/div
/div
noscriptpgoogle-analytics/p/noscript
noscriptpstat./p/noscript
/body
/html
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
8.利用expression(仅对IE)
(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/webkaifa/)HTML代码
div style="background:blue;
position:absolute;
left:expression((body.clientWidth-50)/2);
top:expression((body.clientHeight-50)/2);
width:50;
height:50;"
/div