How to wrap text inside an iframe with designMode on, using css and also javascript if necessary?

有些话、适合烂在心里 提交于 2019-12-11 03:23:54

问题


Any simple solution to this dilemma? I've tried this possible solution, but it didn't seem to work inside iframes.

Help?

JSFiddle Link

EDIT: I've searched myself online, and they all say specify a percentage. But I don't initially have content in it, and I set designMode to 'On'. Just to mention to filter out useless answers.


回答1:


Ha, solved! Used javascript:

myiframe.document.body.style.wordWrap = 'break-word';

that did it when put into window.onload.

Solved, finally!




回答2:


In CSS you could do it by using word-wrap: break-word;



来源:https://stackoverflow.com/questions/11482115/how-to-wrap-text-inside-an-iframe-with-designmode-on-using-css-and-also-javascr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!