简体   繁体   English

不确定HTML是否使用CSS文件,因为对CSS文件所做的更改不会显示在网页上。 我该怎么办?

[英]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.

相关问题 尽管我在 css 文件中进行了一些更改,但我遇到了 styles 没有更改的问题 - I had a problem that the styles do not change although I made some changes in css file 在Eclipse中看不到HTML文件中所做的更改 - Do not see changes made in HTML file in Eclipse 我无法在HTML网页中显示CSS框,应该进行哪些更改? - I cannot get a CSS box to show up in my HTML webpage, what changes should I make? 我正在尝试在网页上动态上下移动元素。 我怎么做? - I'm trying to dynamically move elements up and down on my webpage. How do I do that? HTML 不加载 CSS 文件 - HTML do not load CSS file 如何设置C#项目以从本地.css文件将CSS内联到HTML? PreMailer.Net可以做到这一点吗? - How do I set up a C# project to inline css into HTML from a local .css file? Can PreMailer.Net do this? 如何使用css更改文本框大小? 以及如何将我的 css 文件与我的 html 文件连接起来 - How do I change textbox size using css? And how do I connect my css file with my html file 对更新的CSS文件所做的更改未生效 - Changes to updated CSS file do not take effect 我正在尝试在网页上使用photobooth.js。 它可以在JsFiddle中工作,但不能在本地工作。 做什么? - I am trying to use photobooth.js on a webpage. It works in JsFiddle, but not locally. What do? 无论我做什么,我的图像都不会显示,使用 html 和 css - No matter what I do my image won't show, using html and css
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM