【问题标题】:Bootstrap class to remove background image用于删除背景图像的引导类
【发布时间】:2021-02-10 13:44:21
【问题描述】:

是否有任何可以从 div 中删除背景图像的引导类?

我在 css 中有这种风格:

background-image: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0));

我想像这样删除它:

bg-img-none

或者别的什么,

谁能告诉我怎么做?

【问题讨论】:

  • 如果存在这方面的课程,您是否阅读过文档?你为什么不写自己的课?

标签: javascript html css typescript bootstrap-4


【解决方案1】:

您可以使用bg-transparent 使背景透明。这不会使背景为空,而是将区域的透明度更改为 0。 你可以在bootstrap documnetation查看它。本文档适用于彩色背景。 您可以添加自定义 CSS 来移除背景

.bg-img-none{
background-image: none;
background: none;
}

【讨论】:

    【解决方案2】:

    ‍‍‍没有,但您可以自己添加。

    .bg-img-none {
        background-image: none !important;
    }
    .bg-none {
        background: none !important;
    }
    

    【讨论】:

    • 你不需要!important。只需确保 css 属性具有正确的选择性和顺序即可。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多