I am trying to apply text-align: justify and reduce the text width on a Django template file, but it seems that my CSS isn't working for only this specific element. I have no idea how to solve this issue even though my static files and direction are functioning correctly. Here is my current CSS script:
#name1{
text-align: justify;
width: 20%;
}
#name2{
position: relative;
text-decoration: none;
color: black;
font-family: lalezar;
}
And here is my HTML code:
<html>
<header>
<body>
{% for item in post %}
<div id="post1">
<a href="{% url 'page_detail' item.pk %}" id="name2"><h2 id="name1">{{item.title}}</h2></a>
<h3>{{item.author}}</h3>
</div>
{% endfor %}
</body>
</header>
</html
I have tried searching on Google for a solution, but unfortunately, I haven't found anything helpful yet.