Created
January 8, 2014 10:14
-
-
Save gustaff-weldon/8314584 to your computer and use it in GitHub Desktop.
icon, content is icon sign
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
body { | |
font-size: 1.6rem; | |
} | |
.container { | |
width: 20%; | |
padding: 2%; | |
float: left; | |
} | |
/* icon, content is icon sign */ | |
.icon:before { | |
content: "§"; | |
} | |
/* icon size */ | |
.icon-size-m:before { | |
font-size: 1.3rem; | |
width: 2rem; | |
height: 2rem; | |
} | |
.icon-size-xl:before { | |
font-size: 4rem; | |
width: 2rem; | |
height: 2rem; | |
} | |
/* icon with text */ | |
.icon-with-text { | |
display: table; | |
} | |
/* icon image is just a table cell */ | |
.icon-with-text:before, | |
.icon-with-text span { | |
display: table-cell; | |
} | |
.icon-with-text-middle:before, | |
.icon-with-text-middle span { | |
vertical-align: middle; | |
} |
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
<section class="container"> | |
<p>default vertical align</p> | |
<p><span class="icon icon-with-text icon-size-m"><span>Small icon with text</span></span></p> | |
<p><span class="icon icon-with-text icon-size-m"><span>Less text</span></span></p> | |
<p><span class="icon icon-with-text icon-size-xl"><span>Big icon with text</span></span></p> | |
<p><span class="icon icon-with-text icon-size-xl"><span>Less text</span></span></p> | |
</section> | |
<section class="container"> | |
<p>vertical align: middle</p> | |
<p><span class="icon icon-with-text icon-with-text-middle icon-size-m"><span>Small icon with text</span></span></p> | |
<p><span class="icon icon-with-text icon-with-text-middle icon-size-m"><span>Less text</span></span></p> | |
<p><span class="icon icon-with-text icon-with-text-middle icon-size-xl"><span>Big icon with text</span></span></p> | |
<p><span class="icon icon-with-text icon-with-text-middle icon-size-xl"><span>Less text</span></span></p> | |
</section> |
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
// alert('Hello world!'); |
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
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment