請(qǐng)問一下 為什么樣式這樣寫 然后我點(diǎn)了那個(gè)p看它的整體高度居然是16 而不是 12+1+1 = 14呢?
擁有18年軟件開發(fā)和IT教學(xué)經(jīng)驗(yàn)。曾任多家上市公司技術(shù)總監(jiān)、架構(gòu)師、項(xiàng)目經(jīng)理、高級(jí)軟件工程師等職務(wù)。 網(wǎng)絡(luò)人氣名人講師,...
The height of
p is not set. The default is to adapt according to the height of the content. Because the height of the content is 14px, the final display effect is 16px, which is not the font-size you set. The specific height is related to the letter type, font type, and whether it is a Chinese character. If you remove the three points inside, the height of p will be 2px. If there are two lines of text, the height will change again, not 12px. In another case, if you set a font smaller than 12px, it will only be displayed up to 12px on a PC such as Chrome. I don’t know if what I said is correct, I hope it helps you
The minimum height of text is determined by line-height
when no height is specified.
line-height
is normal
. The specific value varies according to different fonts. Desktop browsers generally have a value of around 1.2.