Skip to content

Instantly share code, notes, and snippets.

@nleush
Created June 30, 2015 14:58
Show Gist options
  • Save nleush/ab375976eb9e6de4d849 to your computer and use it in GitHub Desktop.
Save nleush/ab375976eb9e6de4d849 to your computer and use it in GitHub Desktop.
Centering responsive 100% width block with width contraint.
<style>
.centering-fullwidth {
width: 100%;
}
.constraint-container {
width: 500px;
margin: auto;
}
</style>
<!-- full width centering container -->
<div class="centering-fullwidth">
<!-- 500px width constraint -->
<div class="constraint-container">
<!-- start responsive content -->
<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