twitter-bootstrap 如何仅覆盖页面上一个区域的 CSS Box Sizing?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20430050/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 19:25:31  来源:igfitidea点击:

How to override CSS Box Sizing for just one area on page?

htmlcsstwitter-bootstrap

提问by TK123

I have the following CSS inside my Twitter Bootstrap file:

我的 Twitter Bootstrap 文件中有以下 CSS:

*,
*:before,
*:after {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

It is causing a problem with my TinyMCE editor, mainly the resizing of the textarea. Anyway if I remove the above code all is good, but obviously I need it in place cause otherwise the rest of Bootstrap breaks.

它导致我的 TinyMCE 编辑器出现问题,主要是调整 textarea 的大小。无论如何,如果我删除上面的代码一切都很好,但显然我需要它到位,否则其余的 Bootstrap 会中断。

So how do I override the above for just TinyMCE? I tried this:

那么我如何只为 TinyMCE 覆盖上述内容?我试过这个:

.tinymce-editor,
.tinymce-editor:before,
.tinymce-editor:after {
    -webkit-box-sizing: content-box !important;
    -moz-box-sizing: content-box !important;
    box-sizing: content-box !important;
}

But no luck. .tinymce-editorhappens to be the div that my editor is inside.

但没有运气。.tinymce-editor恰好是我的编辑器所在的 div。

回答by TK123

Nevermind just got it:

没关系刚刚得到它:

.tinymce-editor *,
.tinymce-editor *:before,
.tinymce-editor *:after {
    -webkit-box-sizing: content-box !important;
    -moz-box-sizing: content-box !important;
    box-sizing: content-box !important;
}