Home > OS >  background image does not want to strech to full width within the section container
background image does not want to strech to full width within the section container

Time:08-16

as you can see in my code example and the screenshot the image won't fit the container even with 100% width or whatever property I try to use. Below you can find my code

.about-us{

    background-image: url(images/about-us-background.png);
    width: 100%;
    height: 100vh;
    background-repeat: no-repeat;
}

Even though I have got another section with the same code and it definitely works with the same piece of code. Here I don't see any issue but still, it is not working.web page screenshot

CodePudding user response:

Try to change the width part as it was 100% its stretch up to container width

Example width: 3vw; (Change according to u)

CodePudding user response:

you should also add background-size:cover;

CodePudding user response:

you can add background-cover : cover or 100% 100% or object-fit : cover in your css

  • Related