Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

responsive background


Recommended Posts

Hello all,

I try to make a responsive background.

the background is an image with a baroque print on the left top and the right bottom.

I have done the following, but it does not work.

what I'm doing wrong.. :(

@[member=media] (min-width: 768px) {
  body {
    background: url(images/background.jpg);
  }
}

@[member=media] (min-width: 992px) {
  body {
    background: url(images/background.jpg);
  }
}

@[member=media] (min-width: 1200px) {
  body {
    background: url(images/background.jpg);
  }
}
Link to comment
Share on other sites

@@phil

 

the background shows up, but when I shrink the site the background image will not reduced.

it remains the same size.

So the baroque print disappears from the screen when I shrink the screen size.

but it should also reduce​.

Link to comment
Share on other sites

You are always using the same image, so how can you expect that something change? You need to upload 3 different images

 

Other option is to use the "background-size" property

 

Try for example

body {
  background: url(images/background.jpg);
  background-size: 100% 100%;
  }

Or try

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

Some more reading: https://css-tricks.com/perfect-full-page-background-image/

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...