line-height
属性值可以使用固定值如:20px..和百分比如:20%。line-height
属性实践,实践内容如:将p
标签行高设置为20px。代码块
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>设置字符和单词距离</title> <style> p{ line-height: 20px; } </style> </head> <body> <p>成功不是打败别人,而是改变自己。</p> <p>成功不是打败别人,而是改变自己。</p> <p>成功不是打败别人,而是改变自己。</p> </body> </html>
结果图
注意:使用百分比如下简陋的代码块。
<style> p{ line-height: 20%; } </style>
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
css3 flex布局 justify-content:space-between 最后一行左对齐
网友评论