Answers for "div image background fit"

CSS
10

css background image fit

body {
    background-image:    url(images/background.svg);
    background-size:     cover;                      /* <------ */
    background-repeat:   no-repeat;
    background-position: center center;              /* optional, center the image */
}
Posted by: Guest on April-24-2020
1

stretch background image to fit div

body {
    background-image:url("../images/myImage.jpg");
    background-repeat: no-repeat;
    background-size: 100% 100%;
}
Posted by: Guest on October-03-2021

Code answers related to "div image background fit"

Browse Popular Code Answers by Language