I’m doing a Django project and I’m using the blog example from Bootstrap 5
I’m trying to embed an image into the first div. So it goes from this:
To this:
How can I do that?
This is the div I’m trying to edit:
<div class="p-4 p-md-5 mb-4 rounded text-bg-dark">
<div class="col-md-6 px-0">
<h1 class="display-4 text-white fst-italic">We are opening our 4th location in March 2023</h1>
<p class="lead my-3">Multiple lines of text that form the lede, informing new readers quickly and
efficiently about what’s most interesting in this post’s contents.</p>
<p class="lead mb-0"><a href="#" class="text-white fw-bold">Continue reading...</a></p>
</div>
</div>
The full example code can be downloaded from here.
2
Answers
You will want the
background
property, you can attach a URL to it.You may then want to Apply a filter to a background image
Add a background property to the div: