课程: CSS Essential Training

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Line-height and letter-spacing

Line-height and letter-spacing - CSS教程

课程: CSS Essential Training

Line-height and letter-spacing

- [Instructor] Let's take a look at two more text-based CSS properties, line height and letter spacing. Line height sets the vertical spacing between lines of text. It can be used with different value types, including length, number, percentage, and the keyword normal. The letter spacing property sets the horizontal spacing between text characters. It can be defined with length values and the keyword normal. Let's go back to the code pin from the previous lesson. Line height is related to font size, which right now is displaying the default value of 16 pixels. I'll start by commenting out the styles from the previous exercise. Now, let's add line height to the P element. If the value is the same as the font size, there will be no space between the lines. If the value is smaller, then the lines will overlap. To add space between the lines, choose a value that is larger than the font size which will make it easier to…

内容