D
D
Dimets2019-11-19 22:29:42
Django
Dimets, 2019-11-19 22:29:42

css not applied in django - what's the problem?

I started to study django, it's version 2.2.5
When Bootstrap is connected, css styles are applied. When you try to use your styles - nothing happens ... What's the problem?
The page itself:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

    <link rel="stylesheet" href="static/my.css">

    <title>Title</title>
</head>
    <body>
        <div class="box">
            Контейнер as1
        </div>
        <div class="box">
            Контейнер 403
        </div>
    <h1 class="tit3">Hello</h1>
    <p>text</p>
</body>
</html>

Here is my.css file:
div.box{
 height:200px;
 width:200px;
 text-align:center;
 font-size:14px;
 color:#090;
 background-color:powderblue;
 margin-right:10px;
}

.tit3{
 color: #009900;
 text-align: center;
}

In settings.py it says STATIC_URL = '/static/'
In fact, nothing applies...
5dd4429127cfc444381881.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2019-11-19
@Dimets

and here everyone needs to poke into the documentation https://docs.djangoproject.com/en/2.2/intro/tutorial06/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question