Baidu Rich Text Adaptive mobile phone screen method

Source: Internet
Author: User

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
Source: MU-Class Network

Baidu Rich Text Adaptive mobile phone screen method

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.