Created
March 8, 2013 21:43
-
-
Save anonymous/5120129 to your computer and use it in GitHub Desktop.
A CodePen by Anonymous.
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
<div class="composition vertical expand"> | |
<div class="v-label">Child 1</div> | |
<div class="v-label expand">Child 2</div> | |
<div class="v-label expand">Child 3</div> | |
</div> | |
<br> | |
<div class="composition horizontal expand"><div class="v-label expand">Child 1</div><div class="v-label">Child 2</div><div class="v-label">Child 3</div> | |
</div> |
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
html, | |
body { | |
height: 100%; | |
} | |
body { | |
font-family: sans-serif; | |
padding: 20px; | |
margin: 0; | |
} | |
.composition, | |
.v-label { | |
box-sizing: border-box; | |
display: inline-block; | |
} | |
.composition { | |
outline: 1px dashed gray; | |
margin: 0 0 10px 0; | |
} | |
.vertical.composition > .v-label { | |
display: block; | |
} | |
.v-label { | |
width: 6em; | |
height: 1.5em; | |
outline: 1px solid rgba(0,0,0,.2); | |
} | |
.expand.horizontal::before { | |
content: ""; | |
margin-left: -12em; | |
} | |
.expand.horizontal { | |
padding-left: 12em; | |
width: 100%; | |
} | |
.expand.horizontal > .expand { | |
width: 100%; | |
} | |
.expand.vertical::before { | |
content: ""; | |
margin-top: -1.5em; | |
display: block; | |
} | |
.expand.vertical { | |
padding-top: 1.5em; | |
/* 100% */ | |
height: 50%; | |
} | |
.expand.vertical > .expand { | |
height: 50%; | |
} | |
/* | |
Make this fully usable as a client side widget, so it can be used to render the caption wrappers as well (use the label element for captions) | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment