I have a website (g-floors.eu) and I want to make the background (in css I have defined a bg-image for the content) also responsive. Unfortunately I really don't have any idea on how to do this except for one thing that I can think of but it's quite a workaround. Creating multiple images and then using css screen size to change the images but I wanna know if there is a more practical way in order to achieve this.
Basically what I wanna achieve is that the image (with the watermark 'G') automatically resizes without displaying less of the image. If it's possible of course
link: g-floors.eu
Code I have so far (content part)
#content {
background-image: url('../images/bg.png');
background-repeat: no-repeat;
position: relative;
width: 85%;
height: 610px;
margin-left: auto;
margin-right: auto;
}
This is an easy one =)
Take a look at the jsFiddle demo
Adaptive for square ratio with jQuery
If you want the entire image to show irrespective of the aspect ratio, then try this:
This will show the entire image no matter what the screen size.
Here is the best way i got.
Check on the w3schools
More Available options
I think, the best way to do it is this:
In this way there's no need to do nothing more and it's quite simple.
At least, it works for me.
I hope it helps.