Home > Software design >  I don't know thy but the background image is not loading properly. Only a part of it is being l
I don't know thy but the background image is not loading properly. Only a part of it is being l

Time:01-07

[The image is not loading properly[Css code 1[css code 2html code](https://i.stack.imgur.com/zyV9f.png)](https://i.stack.imgur.com/O7vp8.png)](https://i.stack.imgur.com/wFWbl.png)

the full picture which i want there is enter image description here

CodePudding user response:

Try this but the size of the image is 1600x800 try to find a 1900x800 size image

   .header{
            background-image: url('/your-image);
            aspect-ratio: 1;
            background-repeat: no-repeat;
            object-fit: fill;
          }

CodePudding user response:

personally, i use those styles for background-image. Give it a shot.

object-fit: cover;
or
background-size: cover;
background-position: center; //i add this as well alongside the bg-size
  • Related