[英]Not sure if HTML is using CSS file because changes made to CSS file do not show up on webpage. What do I do?
I am tasked with making an alert on the "Beta: Empty Bedspaces" and "Beta: Hall Roster With Empty Beds" reports. 我的任务是在“测试版:空床位”和“测试版:带有空床的大厅花名册”报告中发出警报。 I have to put the alert in at the top of the page.
我必须将警报放在页面顶部。 I want it to be centered and not take up the whole width of the page.
我希望它居中,而不要占用页面的整个宽度。
Putting in inline styles work, but I am not sure if it is reading the CSS file. 内联样式可以工作,但是我不确定是否正在读取CSS文件。 Considering this is for a job, I can't really move the file itself around, and I am 99% sure it's in a good file location as that's where my coworkers/boss already has it.
考虑到这是一项工作,我无法真正移动文件本身,而且我99%确信它位于一个好的文件位置,因为我的同事/老板已经拥有该文件。
HTML code: HTML代码:
{% extends 'reports_templates/base.html' %}
{% load static from staticfiles %}
{% block extra-head %}
<link rel="stylesheet" type="text/css" href="{% static 'datatables/media/css/jquery.dataTables.min.css' %}">
<link rel='stylesheet' type='text/css' href="{% static 'css/empty_bedspaces.css' %}">
{% endblock %}
{% block title %}
<title>Empty Bed Spaces</title>
{% endblock %}
{% block content %}
<div class="alert alert-danger" id="alert">
<strong>Note:</strong> Some of the rooms below may not be available for assignment.
</div>
CSS code: CSS代码:
.container div {
margin: 1%;
}
#specific-table tr th {
border-bottom: 1px solid #111;
}
th.title {
text-align: center !important;
}
.alert-danger {
font-size: 72px;
}
If I do: 如果我做:
<div class="alert alert-danger" style="margin: 45%" >
<strong>Note:</strong> Some of the rooms below may not be available for assignment.
</div>
It makes it take up an adequate amount of page space. 它占用了足够的页面空间。 Also, keep in mind this is not nearly all the code.
另外,请记住,这几乎不是全部代码。 I didn't want to paste a huge file.
我不想粘贴一个大文件。
Here is a picture of how it looks so far with just the alert div. 这是仅使用警报div到目前为止的外观的图片。
Try clearing your cache, most browsers: CTRL+SHIFT+R. 尝试清除缓存,大多数浏览器:CTRL + SHIFT + R。 While developing, I would also recommend disabling caching locally in your development panel.
在开发过程中,我还建议您在开发面板中禁用本地缓存。 In Chrome it will be F12 > Network Tab > Check Disable Cache.
在Chrome中,依次为F12>网络标签>选中禁用缓存。 You may need to restart your browser to force the changes as well.
您可能需要重新启动浏览器以强制进行更改。
如果您使用的是Bootstrap,则可以将其class="col-md-8 col-md-push-2 text-center".
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.