css: line-height 与box-sizing
生活随笔
收集整理的這篇文章主要介紹了
css: line-height 与box-sizing
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
css
1、line-hight:
行高line-height,是文本行基線這件的距離,不是字體大小,它確定了各個元素框的高度增加或減少多少。
對于塊級元素:定義了元素中文本基線之間的最小距離。
line-height并不影響替換元素的布局,但是確實(shí)可以應(yīng)用到替換元素。
行間距:line-height - font-size
定義font屬性的時候,用戶代理會自動會生成一個line-height。
| 瀏覽器 | ?FF | ||||||
| ?字體大小(font-size) | ?12px? | ?13px | 14px /15px | 16px? | 18px? | 20px? | 22px? |
| ?行高(line-height) | ?17px | ?19px | ?20px | ?21px | ?24px | ?27px | ?30px |
?
| 瀏覽器 | ?Chrome | ||||||
| ?字體大小(font-size) | ?12px? | ?13px | 14px /15px | 16px? | 18px? | 20px? | 22px? |
| ?行高(line-height) | ?17px | ?19px | ?20px | ?21px | ?24px | ?27px | ?30px |
?
| 瀏覽器 | ?IE9 | ||||||
| ?字體大小(font-size) | ?12px? | ?13px | 14px? | 16px? | 18px? | 20px? | 22px? |
| ?行高(line-height) | ?15.8px | ?17.2px | ?18.5px | ?21.2px | ?23.8px | ?26.4px | ?29px |
?
| 瀏覽器 | ?360 | ||||||
| ?字體大小(font-size) | ?12px? | ?13px | 14px /15px | 16px? | 18px? | 20px? | 22px? |
| ?行高(line-height) | ?17px | ?19px | ?20px | ?21px | ?24px | ?27px | ?30px |
在inline元素中,不是文字撐開了div的高度,而是line-height!
?
2、box-sizing
只是為了規(guī)定box modeling
?
box-sizing : content-box || border-box || inherit
content-box 為默認(rèn)值
轉(zhuǎn)載于:https://www.cnblogs.com/flymood/p/4245245.html
《新程序員》:云原生和全面數(shù)字化實(shí)踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀總結(jié)
以上是生活随笔為你收集整理的css: line-height 与box-sizing的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Linux shell脚本基础学习详细介
- 下一篇: ubuntu 更新系统时间