【发布时间】:2017-05-28 11:20:02
【问题描述】:
我正在使用 Bootstrap jumbotron 作为我的网页的标题,并且我有自己的 layout.css,但并不是所有的 .jumbotron 规则都有效。当我尝试设置margin-bottom: 0px; 时,它并没有出现在我的浏览器开发者工具中,甚至没有被划掉。有谁知道如何解决这个问题?
index.html - 带有 jumbotron 类的头部和头部:
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="{{ url_for('static', filename='css/layout.css') }}" rel="stylesheet">
</head>
<header class="jumbotron container-fluid">
<h1> Catalog App </h1>
<button type="button" class="btn btn-xs btn-default btn-login" onclick="location.href='/login/'">Login</button>
</header>
layout.css - .jumbotron:
.jumbotron {
background-color: #195e8c;
margin-bottom: 0px;
padding-top: 2px;
padding-bottom: 2px;
}
开发者工具 - 不显示底部边距:
我确保所有内容都已保存并重新加载服务器。如果这很重要,它可以在一个简单的 Flask python 服务器上运行。
【问题讨论】:
-
尝试把你的 CSS 文件放在 bootstrap css 之后
-
你能为我们复制它吗?
-
@BigMonkey89WithaLeg 它们已经在引导 CSS 之后链接了
-
@MichaelCoker 不知道如何重现它,我所做的只是制作一个基本的 Flask 服务器,如果这有助于提供更多信息,我会附上我的头部和相关代码以及我的开发人员工具的图片
-
您可以导航到
css/layout.css并查看那里列出的margin-bottom?您是否检查过该文件中是否有任何(可能隐藏的)特殊字符?
标签: html css bootstrap-4