0

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. 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.

HTML code:

{% 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:

.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.

7
  • 1
    Try to clear your cache and then reload the page and see if it takes effect Commented Apr 15, 2019 at 17:53
  • Right-Click "inspect page" in your browser and have a look under section "network" if the css file is loaded. Commented Apr 15, 2019 at 17:55
  • @nologin it looks to be there Commented Apr 15, 2019 at 18:02
  • @GrumpyCrouton idk how to do that exactly Commented Apr 15, 2019 at 18:02
  • @HelanaBrock Search google "[insert browser here] clear cache" Commented Apr 15, 2019 at 18:08

2 Answers 2

1

Try clearing your cache, most browsers: 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. You may need to restart your browser to force the changes as well.

Sign up to request clarification or add additional context in comments.

Comments

0

If you are using Bootstrap, you could give it class="col-md-8 col-md-push-2 text-center".

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.