Sunday, 15 May 2011

internet explorer 8 - CSS white-space property in IE8 -



internet explorer 8 - CSS white-space property in IE8 -

i have next html markup (simplified)

<div class="controldiv" style="white-space: nowrap"> <div class="pre"></div><input style="width: 100%"><div class="post"></div> <div class="validationmsg" style="white-space: normal">some message</div> </div>

the inner div (validationmsg) shows dynamically, in ff text message wrapped correctly, it's non longer input field above.

but in ie8 white-space property ignored, text isn't wrapped automatically. did experiments in ie developer tools, have turned of white-space property, when wrapping applied correctly (but fails formating of input fields pre , post symbols, need disable wrapping)

code looks little bit mess, used framework strict, able append new div or paragraph controldiv.

it may not best solution, ie acts nowrap parent applied layout of validationmsg, it's not possible set "white-space: normal" itself. solution have wrapper validationmsg style "width: 100% (or size want apply validationmsg div); white-space: normal", layout looks ie other browsers.

here illustration posted: http://jsbin.com/edeqam/1

it looks consistant on browsers.

css internet-explorer-8 whitespace textwrapping

No comments:

Post a Comment