line height各類屬性值

2022-05-04 22:54:06 字數 1156 閱讀 3029

line-height支援屬性值

1.normal(預設屬性)

跟著使用者的瀏覽器走,且與元素字型關聯

normal值 = 字型大小/100

2.使用數值作為行高值。如:line-height:1.5 根據當前元素的font-size大小計算 line-height = 1.5*20px(font-size) = 30px

3.使用具體長度值作為行高值

4.使用百分比作為行高值

5.inherit(繼承)

input框等元素預設行高是normal,使用inherit可以讓文字框樣式可控性更強

例項1:下有間距

iOS UIButton各類屬性設定大全

設定自定義的按鈕 uibutton button1 uibutton buttonwithtype uibuttontypecustom 設定乙個圓角的按鈕 uibutton button1 uibutton buttonwithtype uibuttontyperoundedrect button...

python 類屬性 用處 Python類屬性詳解

類屬性1.類定義後就存在,而且不需要例項化 2.類屬性使得相同類的不同例項共同持有相同變數 類屬性例項 attrb.py class testcss cssa class attribe def init self self.a 0 self.b 10 def info self print a s...

類屬性 例項屬性

例項屬性 物件屬性 顧名思義,類屬性就是類物件所擁有的屬性,它被所有類物件的例項物件所共有,在記憶體中只存在乙個副本,這個和c 中類的靜態成員變數有點類似。對於公有的類屬性,在類外可以通過類物件和例項物件訪問 例項如下 class people object name tom 公有的類屬性 age ...