Created
October 30, 2017 11:53
-
-
Save tayvano/badaa3d9039aef2e83dfad055b56269a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section class="gallery__block"> | |
<div class="gallery__wrap"> | |
<?php | |
if( $images ): foreach( $images as $image ): | |
$width = $image['sizes'][ 'large-width' ]; | |
$height = $image['sizes'][ 'large-height' ]; | |
$ar = ($width/$height); | |
?> | |
<div class="gallery__inner" style="flex:<?php echo $ar; ?>"> | |
<img src="<?php echo $image['sizes']['large']; ?>" width="<?php echo $width; ?>" height="<?php echo $height; ?>" alt="<?php echo $image['alt']; ?>" /> | |
</div> | |
<?php endforeach; endif; ?> | |
</div> | |
</section> | |
section.gallery__block { | |
text-align: center; | |
max-width: 700px; | |
margin: auto; | |
padding: 0; | |
} | |
.gallery__wrap { | |
display: flex; | |
margin: $space*2 auto; | |
} | |
.gallery__inner { | |
margin: $space/2; | |
img { | |
width: 100%; | |
height: auto; | |
vertical-align: middle; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment