[英]CSS - changes are not taken into account
I am using Bootstrap to display a list and I am trying to customize its list-item-component
.我正在使用 Bootstrap 来显示一个列表,我正在尝试自定义它的
list-item-component
。
I have the following code in my CSS file:我的 CSS 文件中有以下代码:
.list-group-item {
border:0 !important;
padding-top:2px;
padding-bottom:2px;
}
I reference the CSS file like this:我像这样引用 CSS 文件:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link href="list.css" rel="stylesheet" type="text/css">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Restriction Lists</title>
</head>
<body>
<div id="tree"></div>
<script src="ListApplication.js"></script>
</body>
</html>
The Bootstrap code is in the following file(I am using React). Bootstrap 代码在以下文件中(我使用的是 React)。
<script src="ListApplication.js"></script>
Another weird thing is that Chrome Developer Tools does not display the CSS file correctly.另一个奇怪的事情是 Chrome Developer Tools 没有正确显示 CSS 文件。
Try with <meta>
first:先用
<meta>
试试:
<meta http-equiv="content-type" content="text/html" charset="utf-8">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link href="list.css" rel="stylesheet" type="text/css">
and make sure jquery and bootstrap are coded succesfully in your ListApplication.js
并确保在您的
ListApplication.js
成功编码 jquery 和 bootstrap
it should work.它应该工作。
The problem was that I was opening the HTML file from within Webstorm.问题是我是从 Webstorm 中打开 HTML 文件的。 When I was changing the CSS file, the changes were not loaded into the browser upon refresh.
当我更改 CSS 文件时,刷新时更改未加载到浏览器中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.