Fit website background image to screen size

后端 未结 13 865
孤独总比滥情好
孤独总比滥情好 2020-12-01 06:42

I\'m just starting on a website and I already encounter a small problem where I can\'t find a specific solution to.

I wanted to make my website background fit any sc

13条回答
  •  -上瘾入骨i
    2020-12-01 07:27

    Although there are answers to this your questions but because I was once a victim of this problem and after few search online i was unable to solve it but my fellow hub mate helped me and i feel i should share. Examples explained below.

    Folders: web-projects/project1/imgs-journey.png

    background-image:url(../imgs/journey.png);
    background-repeat:no-repeat;
    background-size:cover;
    

    My major points is the dots there if you noticed my journey.png is located inside an imgs folder of another folder so you're to add the dot according to the numbers folders where your image is stored. In my case my journey.png image is saved in two folders that's why two dot is used, so i think this may be the problem of background images not showing sometimes in our codes. Thanks.

提交回复
热议问题