Responsive Image cropping

Samepypehat

New Member
I have been trying to crop an image for screen sizes below 768px width. The image should crop equally from the left and right sides.Here is an Example of the Image at full size (the dimensions of the image are 900px wide by 250px tall.:
H7cpsLK.jpg
Here is the cropped version I have been trying to create once the screen size is less than 768p wide. In this version the image is at 320px wide but it should start cropping at 768px:
SPyI8tK.jpg
Here is the HTML I have been using so far:\[code\]<div class="container"> <div class="image-container"> <img src="http://i.imgur.com/H7cpsLK.jpg" /> </div></div>\[/code\]Here is the CSS:\[code\].container { width: 1280px; max-width: 100%; min-width: 768px;}.image-container { width:100%;}img { max-width:100%; height:auto;}@media only screen and (max-width:768px) { .image-container {max-width:768px; overflow:hidden;}}\[/code\]Here's a fiddle I have been using to try and create this: http://jsfiddle.net/QRLTd/Is it possible to crop an image from both the left and right sides at the same time?
 
Back
Top