css_sduty/11_CSS常用文本属性/07_行高.html

31 lines
1.1 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>07_行高</title>
<style>
#d1 {
font-size: 20px;
background-color: skyblue;
/* 行高 建议 1.7~2倍之间*/
/* 字体设计时 x下沿是基线基线靠下字体偏下
line-height的不能和font-size一样可能会导致文字重叠
line-height: 1.667;比较常用
*/
/* 像素 */
/* line-height: 25px; */
/* line-height: normal; */
/* 倍数 */
line-height: 1.667;
/* 百分比 */
/* line-height: 150%; */
}
</style>
</head>
<body>
<div id="d1">天天向上 步步高升 Lorem ipsum dolor sit amet consectetur adipisicing elit.</div>
<div id="d2">天天向上 步步高升 Lorem ipsum dolor sit amet consectetur adipisicing elit.</div>
<div id="d3">天天向上 步步高升 Lorem ipsum dolor sit amet consectetur adipisicing elit.</div>
</body>
</html>