Last active
August 29, 2015 14:10
-
-
Save starryeyez024/1eb234dcb5fbd5e8b4da 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="ratio"> | |
<div class="fpp"> | |
<div class="fpp-inner"> | |
<div class="field--name-field-fpp-text-body"> More text perhaps, was on the dockett, we could never be sure. How many words will need to fit in the box?</div> | |
<div class="field--name-field-fpp-text-url"> And what if there's more? What then?</div> | |
</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
// ---- | |
// Sass (v3.4.7) | |
// Compass (v1.0.1) | |
// ---- | |
.ratio { | |
height: 0; | |
text-align: center; | |
background: #EEE; | |
margin: 20px; | |
padding-top: 25%; // Ratio of BG image | |
max-width: 40%; // just for demo purposes to keep it small | |
position: relative; | |
} | |
.fpp { | |
display: inline-block; | |
vertical-align: middle; | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
box-sizing: border-box; | |
} | |
.fpp:before { | |
content: ''; | |
display: inline-block; | |
height: 100%; | |
vertical-align: middle; | |
} | |
.fpp-inner { | |
display: inline-block; | |
vertical-align: middle; | |
width: 98%; | |
background: #F5F5F5; | |
} |
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
.ratio { | |
height: 0; | |
text-align: center; | |
background: #EEE; | |
margin: 20px; | |
padding-top: 25%; | |
max-width: 40%; | |
position: relative; | |
} | |
.fpp { | |
display: inline-block; | |
vertical-align: middle; | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
box-sizing: border-box; | |
} | |
.fpp:before { | |
content: ''; | |
display: inline-block; | |
height: 100%; | |
vertical-align: middle; | |
} | |
.fpp-inner { | |
display: inline-block; | |
vertical-align: middle; | |
width: 98%; | |
background: #F5F5F5; | |
} |
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="ratio"> | |
<div class="fpp"> | |
<div class="fpp-inner"> | |
<div class="field--name-field-fpp-text-body"> More text perhaps, was on the dockett, we could never be sure. How many words will need to fit in the box?</div> | |
<div class="field--name-field-fpp-text-url"> And what if there's more? What then?</div> | |
</div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment