Home > Back-end >  Embed an image into div
Embed an image into div

Time:12-15

I'm doing a Django project and I'm using the Before

To this:

It's photoshopped. enter image description here

How can I do that?

This is the div I'm trying to edit:

    <div >
            <div >
                <h1 >We are opening our 4th location in March 2023</h1>
                <p >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 ><a href="#" >Continue reading...</a></p>
            </div>
    </div>

The full example code can be downloaded from here.

CodePudding user response:

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

.headerObject {
  height: 100px;
  width: 300px;
  background: url("https://cataas.com/cat");
  background-size: cover;
}
<div >
  Hello World
</div>

CodePudding user response:

Add a background property to the div:

<div style="background-image: URL('www.server.address/image.jpg');">
</div>
  • Related