在div中设置样式:{background:url(/images/line_t.gif) no-repeat top; color:#5F3E0B; line-height:24px; padding:20px 25px 20px 25px; height:400px;}
由于默认高度为400px,在ie6中div的高度可以自动增加,但是ie7中却不可以,请叫高手究竟问题出在哪里?
关键是使用 expression 实现动态属性设置!
L@_@K
<!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>
<title> new document </title>
<meta name= "generator " content= "editplus " />
<meta name= "author " content= " " />
<meta name= "keywords " content= " " />
<meta name= "description " content= " " />
</head>
<body>
<div id= "divTest " style= "border: 1px solid red; line-height:24px; height: expression(this.style.height> =this.scrollHeight? '100px ':this.scrollHeight+ 'px '); display: block; overflow-y: visible; ">
1231231231313 <br />
12312312313213 <br />
1231231313 <br />
123123af <br />
123123 <br />
123123afae <br />
123123 <br />
123123 <br />
123123 <br />
123123 <br />
123123 <br />
123123 <br />
</div>
</body>
</html>