Created
May 13, 2015 17:54
-
-
Save DannyJoris/8cc9927798000a6d9476 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or 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="container"> | |
<div class="flag"> | |
<div class="flag__image"> | |
<img src="http://placehold.it/75x75" alt=""> | |
</div> | |
<div class="flag__body"> | |
<p>Lorem ipsum dolor etc</p> | |
</div> | |
</div> | |
<div class="flag flag--top"> | |
<div class="flag__image"> | |
<img src="http://placehold.it/75x75" alt=""> | |
</div> | |
<div class="flag__body"> | |
<p>Lorem ipsum dolor etc</p> | |
</div> | |
</div> | |
</div> |
This file contains hidden or 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
// ---- | |
// libsass (v3.2.4) | |
// ---- | |
// Demo from http://csswizardry.com/2013/05/the-flag-object/ | |
.container { | |
width: 960px; | |
margin: 0 auto; | |
} | |
.flag { | |
display: table; | |
width: 100%; | |
margin-bottom: 10px; | |
} | |
.flag__image, | |
.flag__body { | |
display: table-cell; | |
vertical-align: middle; | |
.flag--top & { | |
vertical-align: top; | |
} | |
.flag--bottom & { | |
vertical-align: bottom; | |
} | |
} | |
.flag__image { | |
padding-right: 10px; | |
> img { | |
display: block; | |
max-width: none; | |
} | |
.flag--rev & { | |
padding-right: 0; | |
padding-left: 10px; | |
} | |
} | |
.flag__body { | |
width: 100%; | |
} | |
p { | |
margin-top: 0; | |
} |
This file contains hidden or 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
.container { | |
width: 960px; | |
margin: 0 auto; | |
} | |
.flag { | |
display: table; | |
width: 100%; | |
margin-bottom: 10px; | |
} | |
.flag__image, | |
.flag__body { | |
display: table-cell; | |
vertical-align: middle; | |
} | |
.flag--top .flag__image, | |
.flag--top .flag__body { | |
vertical-align: top; | |
} | |
.flag--bottom .flag__image, | |
.flag--bottom .flag__body { | |
vertical-align: bottom; | |
} | |
.flag__image { | |
padding-right: 10px; | |
} | |
.flag__image > img { | |
display: block; | |
max-width: none; | |
} | |
.flag--rev .flag__image { | |
padding-right: 0; | |
padding-left: 10px; | |
} | |
.flag__body { | |
width: 100%; | |
} | |
p { | |
margin-top: 0; | |
} |
This file contains hidden or 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="container"> | |
<div class="flag"> | |
<div class="flag__image"> | |
<img src="http://placehold.it/75x75" alt=""> | |
</div> | |
<div class="flag__body"> | |
<p>Lorem ipsum dolor etc</p> | |
</div> | |
</div> | |
<div class="flag flag--top"> | |
<div class="flag__image"> | |
<img src="http://placehold.it/75x75" alt=""> | |
</div> | |
<div class="flag__body"> | |
<p>Lorem ipsum dolor etc</p> | |
</div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment