Created
June 30, 2015 14:08
-
-
Save nleush/00e9b4df2c344f4f1687 to your computer and use it in GitHub Desktop.
Centering responsive 100% width block with max-width contraint.
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
<style> | |
.centering-fullwidth { | |
width: 100%; | |
-webkit-justify-content: center; | |
-ms-flex-pack: center; | |
justify-content: center; | |
display: -webkit-flex; | |
display: -ms-flexbox; | |
display: flex; | |
} | |
.constraint-container { | |
width: 100%; | |
} | |
</style> | |
<!-- full width centering container --> | |
<div class="centering-fullwidth"> | |
<!-- 500px width constraint --> | |
<div class="constraint-container" style="max-width: 500px;"> | |
<!-- start responsive content: replace with your responsive embed code --> | |
<div style="width: 100%; background: black; height: 400px;"></div> | |
<!-- end responsive content --> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment