Skip to content

Instantly share code, notes, and snippets.

@alex-boom
Last active February 4, 2019 18:28
Show Gist options
  • Save alex-boom/10f50bb9080d988a1f7ac6208845ad13 to your computer and use it in GitHub Desktop.
Save alex-boom/10f50bb9080d988a1f7ac6208845ad13 to your computer and use it in GitHub Desktop.
amp-proportional-image
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>amp proportional image</title>
<style>
.box-img {
max-width: 300px;
img {
object-fit: contain;
}
}
</style>
</head>
<body>
<div class="box-img">
<amp-img alt="images description"
src="http://placehold.it"
width="1.33"
height="1"
layout="responsive">
</amp-img>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment