-1

I am making a website and want my front page to have a photo that covers the entire background. I have searched and searched but I can't get my image to fit the screen, it automatically zooms in! I have attached an image of what it looks like, the picture is of a pier and all that shows is a zoomed in corner of the pic. Anyone got any tips?

  • 2
    Possible duplicate of [Fit website background image to screen size](https://stackoverflow.com/questions/19925075/fit-website-background-image-to-screen-size) – 0x01 Mar 13 '18 at 19:10
  • 1
    hi you can find what you want here https://css-tricks.com/perfect-full-page-background-image/ – Alexander Mar 13 '18 at 19:11

2 Answers2

0

You can use

background-repeat: no-repeat;
background-size: cover;
Vega
  • 27,856
  • 27
  • 95
  • 103
0

You can use this CSS

html {
background: url(example.jpg) no-repeat center center fixed; 
}
Abhishek Shah
  • 436
  • 1
  • 3
  • 12