html - 为单个页面覆盖 Bootstrap 样式

标签 html css twitter-bootstrap

我尝试通过将值更改为“margin-bottom:0”来覆盖 .nav 中的“margin-bottom:20px”,但它确实有效。它只对特定网页使用一次。

不知道怎么办?

我仍然想保留原来的值“margin-bottom: 20px”,因为它在其他网页中使用。

<style>

.nav{
margin-bottom: 20px;
}

</style>

enter image description here

最佳答案

使用内联样式,它具有更高的优先级并且可以工作,因为您仅将其用于单个页面。

<div class="nav" style="margin-bottom: 0;">

关于html - 为单个页面覆盖 Bootstrap 样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30665654/

相关文章:

html - CSS 高度、居中和边距问题

css - FullCalendar 5 与 Bootstrap 4 顶部菜单下的粘性资源

php - 如何使用 TWIG 链接文本中的哈希标记词(例如,这是一个#RandomWord)?

javascript - 如何找出容器元素内的文本位置?

html - 菜单中央的 Logo 图像位置不正确

css - 图片超出父尺寸

php - 使所有 CSS 内联 - Class Issue

html - 仅隐藏直接文本子项,不隐藏 CSS 中的元素子项

javascript - 表单未使用 BootStrap 验证必填字段

html - 让导航栏重叠标题?