开发者

IE6 expressions: getting a parent element's height

开发者 https://www.devze.com 2023-01-09 06:50 出处:网络
Let\'s say I have this markup: <div class=\"foobar\"> <div style=\"height:expression(this.parent.style.height + \'px\')\"></div>

Let's say I have this markup:

<div class="foobar">
   <div style="height:expression(this.parent.style.height + 'px')"></div>
</div>

My expression doesn't work, but you can probably tell what I'm trying to do by it: get the height of the parent element.

Please, if you cannot answer the question do not bother r开发者_Python百科eplying. This is for a VERY, VERY specific bug that only affects IE. Either an expression must be used, or the bug cannot be fixed.


<div class="foobar">
   <div style="height:expression(this.parentNode.offsetHeight + 'px')">test</div>
</div>


Inherit the height of the parent:

<div class="foobar">
   <div style="height:inherit;"></div>
</div>
0

精彩评论

暂无评论...
验证码 换一张
取 消