offsetWidth or CSS expression problem for IE6

Posted by Bipul on Stack Overflow See other posts from Stack Overflow or by Bipul
Published on 2010-03-27T10:05:55Z Indexed on 2010/03/27 10:13 UTC
Read the original article Hit count: 419

Filed under:
|
|

I need to set the width of textboxes as 80% of it's parent. So first I used

td input[type="text"]
{    
    width: 80%;
}

But it was not rendering properly if the input is the child of td. So, I used Css expressions

td input[type="text"]
{    
    width: expression(this.parentNode.offsetWidth*0.8);
}

It is working as I wanted in every browser except IE 6. Can anybody help me, where I am going wrong? I know that expressions are allowed in IE 6. So, is it the problem of using css expression or something to do offsetWidth.

Thanks in advance.

© Stack Overflow or respective owner

Related posts about css-expressions

Related posts about css