claudiopb
claudiopb

Reputation: 1100

How to resize background image size when resizing the browser window?

I wanted to reproduce exactly what happens on this site from the link below:

https://tormentor.hu/

with the background image adjusting on the browser screen. The way I did it is almost good. But the image only fits on small screens when I refresh the page. In the example of the site it is showing it adjusts without refresh.

Here is my attempt:

body{
  background-image:url('/images/background.jpg');  
  background-size:cover;
}

Upvotes: 0

Views: 145

Answers (1)

Timppa
Timppa

Reputation: 363

This is what they have in their site as style:

background: url(assets/images/background2.jpg) no-repeat fixed black;
background-size: 100%

Upvotes: 1

Related Questions