Created
November 18, 2013 18:30
-
-
Save andrewjmead/7532855 to your computer and use it in GitHub Desktop.
fluid-center
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
/* ============================================================================= | |
Fluid Center | |
========================================================================== */ | |
// Given the following DOM structure, elements are centered relative to the parent | |
// and can accomodate varied-width inner content | |
// <div class="fluid-center"> | |
// <div class="inner-wrap"> | |
// <div class="offset"> | |
// Any content here | |
// </div> | |
// </div> | |
// </div> | |
.fluid-center { | |
position: absolute; | |
left: 50%; | |
.inner-wrap { | |
position: relative; | |
right: 50%; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment