Home > Software design >  How to get an image in a div to completely occupy it Html and CSS?
How to get an image in a div to completely occupy it Html and CSS?

Time:03-28

How to get an image in a div to completely occupy it Html and CSS ?

CodePudding user response:

You could place an image as a background like.

html

<div ></div>

css

.mydiv {
background-image: img/whatever.jpg;
background-size: cover;
background-repeat: no-repeat
}
  • Related