Baidu editor added to the picture on the phone can not self-adaptive problem
Do the site often use Baidu Editor, page rendering we generally use {$content}
to display, at this time in the mobile phone will appear the first width over the size of the phone, the problem, with the max-width:100%;
limit after it will be found high or so high, no proportional scaling, find the next Niang the following list of solutions:
Debugging found that the style in the, tag is the problem that affects the mobile self-adaptation. Removing the entire style will not affect the size of the PC-side picture, but will also enable adaptive recovery.
Baidu Editor will automatically add the picture to set the width of the property, so we have to kill the two lines of code-find JS location ueditor/ueditor/dialogs/image, Locate the Image.js file, open the edit, and set the width-height attribute on line No. 272 and line 279, shielding itstyle: "width:" + data[‘width‘] + "px;height:" + data[‘height‘] + "px;"
And then on the page a little limit
<div class="test"> {$content} </div> <style> .test img{display:block;max-width:100%;height:auto;} </style>
Xiao Zhu
Links: http://www.imooc.com/article/13297
Source: MU-Class Network
Baidu Rich Text Adaptive mobile phone screen method