This paragraph has width: 200
, without a unit.
document.write()
to create a local iframe in strict mode:
A javascript:
URL also works:The upshot is that if you have a UI component that needs to render in strict mode, but might be hosted by a page in quirks mode, you can solve your problem by creating your own iframe using the technique above and writing your UI component into the iframe. This also lets you declare CSS classes within the iframe and you won't have to worry about the CSS classes of the UI component conflicting with those of the host page (which may be helpful even if the host page is in strict mode).