Last active
December 18, 2015 01:49
-
-
Save RockyMyx/5707025 to your computer and use it in GitHub Desktop.
CSS: using-unitless.css
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
/** | |
* From:http://webdesign.tutsplus.com/articles/typography-articles/taking-ems-even-further/ | |
**/ | |
<style type="text/css"> | |
article | |
{ | |
/*The paragraph’s line-height is now relative to its own font-size*/ | |
line-height: 1.5; | |
/*使用1.5em,由于继承性,line-height的值始终保持为1.5 * 16 = 24,而实际上想要的是1.5 * 20 = 30*/ | |
/*line-height:1.5em;*/ | |
} | |
article p | |
{ | |
font-size: 1.25em; /*16*1.25=20*/ | |
} | |
</style> | |
<article> | |
<p> | |
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptates, molestiae, omnis, laudantium, animi eos veritatis cumque temporibus quibusdam ex officiis nulla itaque doloribus nobis mollitia pariatur molestias aspernatur qui quos. | |
</p> | |
</article> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment