stretch background image to fit div
body {
background-image:url("../images/myImage.jpg");
background-repeat: no-repeat;
background-size: 100% 100%;
}
stretch background image to fit div
body {
background-image:url("../images/myImage.jpg");
background-repeat: no-repeat;
background-size: 100% 100%;
}
background image fill div
div {
background-image: url("example.com/image.png");
background-repeat: no-repeat;
background-size: cover;
}
how to set a full size background image in html
<head>
<style>
#example1{
border: 2px solid black;
padding: 100px;
background: url(mountain.jpg);
background-repeat: no-repeat;
background-size: 100% 100%;
}
</style>
</head>
<body>
<div id="example1">
</div>
</body>
make image stretch to fit div
Just apply without any changing any code
img {
width: 100%;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us