Skip to content

Instantly share code, notes, and snippets.

@robdecker robdecker/1.css
Created Feb 25, 2020

What would you like to do?
[Vertical align image in overflow:hidden div] #css
div {
position: relative;
overflow: hidden;
img {
position: absolute;
top: 50%;
transform: translate(0, -50%);
<img src="some-image.jpg" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.