Reputation:
I am working on a responsive site in which background is a large image as seen in the first image.
If I reduce the width of the browser automatically left and right edges should get trimmed like as shown in the second image. Center is focused.
How to do this?
Upvotes: 1
Views: 291
Reputation: 11
@AngelGuy ,
use the following css :
background-image:url('bigImg.jpg');
background-size:cover;
background-repeat:no-repeat;
For a particular screen size with fixed height, resizing the width of the browser will not resize the image, the edges of the image will be trimmer.
Upvotes: 1