gpt4 book ai didi

javascript - 使用 Javascript 而不是 css 覆盖 bootstrap maxWidth

转载 作者:行者123 更新时间:2023-11-28 11:48:28 25 4
gpt4 key购买 nike

所以我有一个 .js 文件包含这个:

var styles = {
wrap: {
left: 0
, top: 0
, overflow: 'hidden'
, margin: 0
, padding: 0
, height: '100%'
, width: '100%'
, zIndex: -999999
}
, img: {
position: 'absolute'
, display: 'none'
, margin: 0
, padding: 0
, border: 'none'
, width: 'auto'
, height: 'auto'
, maxHeight: 'none'
, maxWidth: 'none'
, zIndex: -999999
}
};

并且 maxWidth 行被 Bootstrap 覆盖。我想通过有效地使 maxWidth !important 来覆盖 Bootstrap ,但是我不确定这样做的正确语法,例如:

, maxWidth: 'none !important'

不起作用。我可以通过在样式表中添加重要规则来解决这个问题,但我正在寻找不需要使用样式表的解决方案。

最佳答案

将包含这些值的 js 放在引导文件之后。 (或者只是为了确定,将其放在页面末尾)

关于javascript - 使用 Javascript 而不是 css 覆盖 bootstrap maxWidth,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20389675/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com