當(dāng)前位置:
首頁(yè) >
css: line-height 与box-sizing
發(fā)布時(shí)間:2025/4/9
38
豆豆
生活随笔
收集整理的這篇文章主要介紹了
css: line-height 与box-sizing
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
css
1、line-hight:
行高line-height,是文本行基線這件的距離,不是字體大小,它確定了各個(gè)元素框的高度增加或減少多少。
對(duì)于塊級(jí)元素:定義了元素中文本基線之間的最小距離。
line-height并不影響替換元素的布局,但是確實(shí)可以應(yīng)用到替換元素。
行間距:line-height - font-size
定義font屬性的時(shí)候,用戶代理會(huì)自動(dòng)會(huì)生成一個(gè)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元素中,不是文字撐開(kāi)了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的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Linux shell脚本基础学习详细介
- 下一篇: ACM 常见词汇