Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save temsool/cb51291dc546dd70a832d8e988b0dae1 to your computer and use it in GitHub Desktop.
Save temsool/cb51291dc546dd70a832d8e988b0dae1 to your computer and use it in GitHub Desktop.
Image ratio on featured image widget elementor
@temsool
Copy link
Author

temsool commented Oct 4, 2018

widget css:


.has-ratio .elementor-image{
    overflow: hidden;
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.has-ratio .elementor-image img{
height: auto;
    width: 100%;
 position: absolute;
    top: calc(50% + 1px);
    left: calc(50% + 1px);
    -webkit-transform: scale(1.01) translate(-50%,-50%);
    -ms-transform: scale(1.01) translate(-50%,-50%);
    transform: scale(1.01) translate(-50%,-50%);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment