Home > database >  my css codes does not work on some parts of my django project
my css codes does not work on some parts of my django project

Time:09-03

So i am building a website with django but my css code working some parts while some parts dont. this is my home.html

{% extends 'base.html' %}

{% load static %}

<html>

<head>
    <link rel="stylesheet" type="text/css" href="{% static '/static/css/home.css'%}">
    <script src="{% static 'fontawesomefree/js/all.min.js' %}"></script>
    <link href="{% static 'fontawesomefree/css/all.min.css' %}" rel="stylesheet" type="text/css">
</head>

<body>
    {% block content %}
    <div >
        <div >
            {% for product in product_list %}
            <div >
                <img src="{{ product.image }}" alt="{{product.title}}">
            </div>
            <div >
                <div >
                    <h3>{{product.title}}</h3>
                </div>
                <div >
                    <h2>13.40$</h2>
                </div>
                <div >
                    <i ></i>
                    <i ></i>
                    <i ></i>
                    <i ></i>
                    <i ></i>
                </div>
            </div>
            {% endfor %}
        </div>
    </div>

    {% endblock %}

</body>

</html>

and this is home.css

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-content: center;
    min-height: 100vh;
    background: #dcdcdc;
}

.image {
    width: 10%;
}
.container {
    position: relative;
    width: 1200px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr))
}

I can change color of page but i cannot change the display or i cannot change sequence of items. devtool

this usually happens because of django caching to make pages load faster...

CodePudding user response:

IMAGE So i did as you say Ali fareeq, and i saw that home.html is in some weird situation because whole page coming with "/" tag but home.html and home css does not coming by theirselfs so im considering make base.html to home.html if i cant get a solution till today.

  • Related