Wrap Text inside fixed Div with css or javascript?

后端 未结 2 1089
情歌与酒
情歌与酒 2020-12-11 08:17

I have tinymce editor(textarea) and one div. Whenever I type inside the text editor, it shows at the preview div which is (200px) in real time which is looks alike stackover

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-11 08:56

    I may be misunderstanding your issue, but it seems like all you need is a bit of CSS, specifically a max-width (for all the non-idiotic browsers) and a width with a wacky IE expression (for IE).

    For instance

    max-width:200px;
    _width:expression(document.body.clientWidth > 200? "200px": "auto" );
    

    When you combine that with the CSS you already have, it seems like it should work.

提交回复
热议问题