Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【每日前端】em / rem / line-height / SCSS guide #3

Open
jctang1202 opened this issue Sep 28, 2017 · 0 comments
Open

【每日前端】em / rem / line-height / SCSS guide #3

jctang1202 opened this issue Sep 28, 2017 · 0 comments
Labels

Comments

@jctang1202
Copy link
Owner

jctang1202 commented Sep 28, 2017

EM / REM 单位值

https://webdesign.tutsplus.com/zh-hans/tutorials/comprehensive-guide-when-to-use-em-vs-rem--cms-23984

line-height

The line-height property in CSS controls the space between lines of text.

The line-height property defines the amount of space above and below inline elements. That is, elements that are set to display: inline or display: inline-block.

the amount of space above and below 可以理解为行内元素的 lines of text 的上半行距和下半行距。

https://css-tricks.com/almanac/properties/l/line-height/
https://segmentfault.com/a/1190000003038583

文章给出示例图:

2587037021-55bacfa692fb8_articlex

半行距 = (line-height - font-size)/ 2

给行内元素设置 line-height 相当于添加了上半行距和下半行距

行盒的高度由其内容最高的一个决定。如果是都是纯 inline 元素,则其高度由最高的 line-height 计算值决定;而如果包括了 inline-block,则 inline-block 的 margin(上下),border(上下),padding(上下),height 都会影响整体行盒的高度

http://coding.imweb.io/demo/p3/vfm/ifc-height.html

SCSS

  • Variables
  • Nesting
  • Partials
  • Import
  • Mixins
  • Inheritance
  • Operators

http://sass-lang.com/guide

@jctang1202 jctang1202 added the CSS label Sep 28, 2017
@jctang1202 jctang1202 changed the title 【每日前端】EM / REM 【每日前端】em / rem Sep 28, 2017
@jctang1202 jctang1202 changed the title 【每日前端】em / rem 【每日前端】em / rem / line-height Sep 29, 2017
@jctang1202 jctang1202 changed the title 【每日前端】em / rem / line-height 【每日前端】em / rem / line-height / SCSS Sep 29, 2017
@jctang1202 jctang1202 changed the title 【每日前端】em / rem / line-height / SCSS 【每日前端】em / rem / line-height / SCSS guide Sep 29, 2017
@jctang1202 jctang1202 changed the title 【每日前端】em / rem / line-height / SCSS guide em / rem / line-height / SCSS guide Oct 23, 2017
@jctang1202 jctang1202 changed the title em / rem / line-height / SCSS guide 【每日前端】em / rem / line-height / SCSS guide Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant