gpt4 book ai didi

Bootstrap 中的 css 选择器特异性不起作用

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

我有这个标记:

<section id="home" class="spacing"> 

<div class="container">
<div class="row">...SOME CONTENT...</div>
</div>

<div class="container-fluid">
<div class="row full">...SOME CONTENT...</div>
</div>

</section>

我想在不覆盖默认 Bootstrap 样式的情况下删除边距,我添加了一个类full

我试过这个 .row.full {margin-left:0 !important; margin-right:0 !important;}.full 并且这些都不起作用。

如果我尝试 #home .row 正在工作,但我不想要这个。

这些是行类的默认样式:.row {margin-right:-15px;margin-left:-15px;为什么不工作,我做错了什么?

最佳答案

我现在正在客户端中运行 Twitter-Bootstrap,我这样做是为了尝试一下,它运行良好

.row-full {
margin: 0;
}

那么显然,替换div中的类名

附注您运行的任何自定义样式表都必须在头部的 bootstrap.css 下声明,以便它实际上覆盖 Bootstrap 。也检查一下

关于 Bootstrap 中的 css 选择器特异性不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22461235/

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