<html>
<style type="text/css">
.outer{
position:static;
background-color:black;
}
.content{
height:200px;
background-color:red;}
.pic{
position:absolute;
/*
pic.jpg: 1px height,20px width
*/background:url("pic.jpg") repeat-y ;
height:100%;
width:200px;
right:-20px;margin:0px;
top:0px;
padding-bottom:100%;}</style><div class="toplevel" style="position:absolute;background-color:blue"><div class="outer">
<div class="content">hello,world</div>
<div id="test" class="pic"></div>
</div><div>bottom of pic</div>
<div>bottom of pic</div>
<div>bottom of pic</div>
<div>bottom of pic</div>
</div><html> 使用ie6运行上面的程序。你会看到pic的高度有点不正常。我希望pic的高度与红色区域的高度一致。你可以,且只能修改.pic的css来达到这个目的。要求不能使用javascript,不能出现绝对值。
<style type="text/css">
.outer{
position:static;
background-color:black;
}
.content{
height:200px;
background-color:red;}
.pic{
position:absolute;
/*
pic.jpg: 1px height,20px width
*/background:url("pic.jpg") repeat-y ;
height:100%;
width:200px;
right:-20px;margin:0px;
top:0px;
padding-bottom:100%;}</style><div class="toplevel" style="position:absolute;background-color:blue"><div class="outer">
<div class="content">hello,world</div>
<div id="test" class="pic"></div>
</div><div>bottom of pic</div>
<div>bottom of pic</div>
<div>bottom of pic</div>
<div>bottom of pic</div>
</div><html> 使用ie6运行上面的程序。你会看到pic的高度有点不正常。我希望pic的高度与红色区域的高度一致。你可以,且只能修改.pic的css来达到这个目的。要求不能使用javascript,不能出现绝对值。
<html>
<style type="text/css">
.outer{
position:static;
background-color:black;
}
.content{
height:200px;
background-color:red;
} .pic{
position:absolute;
/*
pic.jpg: 1px height,20px width
*/background:url("pic.jpg") repeat-y ;
height:100%;
width:200px;
right:-20px;
margin:0px;
top:0px;
/*padding-bottom:100%;*/} </style><div class="toplevel" style="position:absolute;background-color:blue"><div class="outer">
<div class="content">hello,world</div>
<div id="test" class="pic"></div>
</div><div>bottom of pic</div>
<div>bottom of pic</div>
<div>bottom of pic</div>
<div>bottom of pic</div>
</div> </html>
请在ie6中运行上面这个程序。你会发现test的div高度很不正常。 我的期望是它与outer的高度一致。在这里看上去的效果应该是与红色区域高度一致。 这个目的很easy。但是,要求如下:第一,只允许修改.pic的css。且不能改动其中的:position。不能修改background:url("pic.jpg") repeat-y ;pic.jpg是x*1的。第二,不能出现绝对值,height:200px这样是行第三,不能使用javascript,不可以出现expression。所实习公司ibm身边的几个regular,都不会。于是他们不管了,让我一个人研究。我只想知道:理论上可行吗???
楼主【hsduren】截止到2008-07-19 17:16:05的历史汇总数据(不包括此帖):
发帖的总数量:0 发帖的总分数:0 每贴平均分数:0
回帖的总数量:1 得分贴总数量:0 回帖的得分率:0%
结贴的总数量:0 结贴的总分数:0
无满意结贴数:0 无满意结贴分:0
未结的帖子数:0 未结的总分数:0
结贴的百分比:---------------------结分的百分比:---------------------
无满意结贴率:---------------------无满意结分率:---------------------
如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html
position:static;
background-color:black;
height:100%;//使用相对高度,加上这一句就可以了}