Home >Web Front-end >HTML Tutorial >The box-sizing style of Bootstrap 3 causes the picture of the UEditor control to not scale normally
UEditor component is a set of open source web online WYSIWYG rich text editor provided by Baidu. It is lightweight, customizable, and focused on user experience. It is based on the MIT protocol and has very powerful functions. Recently, I found that the uploaded pictures (or inserted into existing emoticon pictures) cannot be scaled normally. Select the picture, click and drag the small label on the edge of the picture with the mouse, and the picture can only be reduced but not enlarged. I have tried many methods but can't solve it. I even checked the js source code and found nothing abnormal.
Later I accidentally discovered that Bootstrap was introduced on the page, and Bootstrap unified the box-sizing style to border-box by default. For specific content, please check Bootstrap’s release log: http://blog.getbootstrap.com/2013/08/19/bootstrap-3-released/
For the definition and usage of box-sizing style, you can see here: http://www.w3school.com.cn/cssref/pr_box-sizing.asp
Influential css in Bootstrap:
<span style="color: #800000;">*, *:before, *:after </span>{<span style="color: #ff0000;"> -webkit-box-sizing</span>:<span style="color: #0000ff;"> border-box</span>;<span style="color: #ff0000;"> -moz-box-sizing</span>:<span style="color: #0000ff;"> border-box</span>;<span style="color: #ff0000;"> box-sizing</span>:<span style="color: #0000ff;"> border-box</span>; }
We only need to redefine the css on the page to override the above styles in Bootstrap, such as:
<span style="color: #800000;"> .edui-container *</span>{<span style="color: #ff0000;"> -webkit-box-sizing</span>:<span style="color: #0000ff;"> content-box</span>;<span style="color: #ff0000;"> -moz-box-sizing</span>:<span style="color: #0000ff;"> content-box</span>;<span style="color: #ff0000;"> box-sizing</span>:<span style="color: #0000ff;"> content-box</span>; }<span style="color: #800000;"> .edui-container *:before, .edui-container *:after </span>{<span style="color: #ff0000;"> -webkit-box-sizing</span>:<span style="color: #0000ff;"> content-box</span>;<span style="color: #ff0000;"> -moz-box-sizing</span>:<span style="color: #0000ff;"> content-box</span>;<span style="color: #ff0000;"> box-sizing</span>:<span style="color: #0000ff;"> content-box</span>; }
* .edui-container is the css class used on the parent element that refers to the UEditor component.