I cannot get my custom css to override any of the components of Bootstrap4 in Django project.
I am very new to front-end development and hope that I can ask this question clearly. note: This is an html sheet in a Django project. My custom css sheet is linked properly as I can use it successfully on other components (non-bootstrap) of the page.
The only way I have been able to override any of my bootstrap components is by including the style as an html attribute as seen in the example below where I made the background of the first row blue. I have been working on solving this issue for a couple of days now and the only things I seem to find is to make sure your custom style sheet is loaded after the Bootstrap style sheet. I have my home.css sheet loading after the bootstrap css, but I am not sure if the way Django loads these is interfering with the order.
Any help or suggestions on trouble-shooting this would be greatly appreciated. Thank you.
{% load staticfiles %}
<head>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> </head>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato&display=swap" >
<link rel="stylesheet" href="{% static 'css/home.css' %}" >
</head>
<body>
<!--################# START OF CARD #################-->
{% for product in products.all %}
<div class="card-group">
<div class="card mb-3">
<!-- start second row -->
<div id = "top" style = "background: blue;" class="row no-gutters">
<div class="col-md-6 d-flex">
<div class="card-img-body">
<img src="{{ product.img_url }}" class="card-img img-fluid">
</div>
</div>
<div class="col-md-6 d-flex align-items-center">
<div class="card-body">
<h4 class="card-title text-center">{{product.title}}</h4>
<p class="card-text">{{product.body}}</p>
<p class="card-text text-right"><small class="text-muted">{{product.date_posted_pretty}}</small></p>
</div>
</div>
</div>
<!-- start second row -->
<div class="secondary row no-gutters d-none">
<div class="col-md-6 d-flex align-items-center">
<div class="card-body">
<h6 class="card-subtitle text-center">{{product.product_name}}</h6>
<p class="card-text "><small class="text-muted">{{product.product_description}}</small></p>
</div>
</div>
<div class="col-md-6 d-flex align-items-center">
<div class="card-body text-center">
<a class="btn btn-light" href="#" role="button">Product</a>
<a class="btn btn-light" href="#" role="button">Homepage</a>
<a class="btn btn-light" href="#" role="button">Mission</a>
</div>
</div>
</div>
</div>
</div>
{% endfor %}
<!--################# END OF CARD #################-->
</body>
And here is the css that I have tried, both selecting the class and the id.
.row .no-gutters{
background: blue;
}
#top {
background: blue;
}
After removing the style as the attribute, I would expect this css to override the bootstrap components however that is not the case.