I created the CSS file inside the static
static
css
resume.css
In setting.py, I didn't change any static code.
I called the index.html file in the view.py
Whenever I called the resume.css file from the index.html. It is not working but when I inspect the code, it is showing the right path to resume.css. I am not getting any errors whenever I run the code. so, I couldn't figure out the issue
Here is the HTML code:
<!DOCTYPE html>
<html lang="en">
<head>
<title> resume</title>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
{% load static %}
<link rel="stylesheet" href="{% static 'css/resume.css' %}">
</head>
<body>
<header class="w3-hide-small main-header">
<h1 class=" header"> welcome to my page </h1>
</header>
<header class="w3-show-small w3-hide-medium w3-hide-large main-header">
<h1 class="w3-center header-for-small"> welcome to <br/>my page </h1>
</header>
</body>
</html>
Here is the CSS code:
.main-header{
background-color: antiquewhite;
}
.header{
margin-top: 0px;
margin-left: 50px;
font-size: 25px;
text-transform: uppercase;
color: blue;
text-shadow: 2px 2px;
padding: 15px;
margin-bottom: 0px;
}
.header-for-small{
margin-top: 0px;
font-size: 20px;
font-weight:bold;
text-transform: uppercase;
color: blue;
padding: 15px;
font-family: fontawesome;
margin-bottom: 0px;
}
view.py
def index(request):
return render(request, 'Web/index.html')
this url.py is created by python
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('Web.urls'))
]
this url.py is created by me in the project or app
urlpatterns = [
path('', views.index, name='index'),
]