Reputation: 13
This isn't possible that I know of, but it would be incredibly useful if one of you fine folks has a solution for me. So, if an image does not have enough room to completely display, the right side of the image is cut off. Is it possible to have it instead cut off the left side of the image? My ultimate goal would be as the window size increases, the image fills in on the left side rather than on the right.
Upvotes: 0
Views: 920
Reputation: 26341
The background-position
property used in conjunction with background-size
is probably what you are looking for:
background-position: right center;
background-size: contain;
More information can be found here.
Upvotes: 4
Reputation: 2275
I think this is what you are after, if you don't want the use background image
div {
width:200px;
height:300px;
position:relative;
overflow:hidden;
display:block;
}
img {
display:block;
position:absolute;
}
#left {
left:0px;
}
#right {
right:0px;
}
Upvotes: 0