字间距

div设置css样式text-indent : 20px; 缩进了20px

2、letter-spacing来设置字与字间距_字符间距离,字体间距css样式
使用CSS设置行间距,字间距
即对对应div设置css属性样式为letter-spacing:8px;,字间距为8px

行间距

在CSS中,可以设置行间距,格式如下:
标签名{line-height:参数}

根据参数不同有3种方法:
1.用数字参数设置:
   行间距=字号×参数
2.用单位参数设置:
   行间距=参数
3.用比例参数设置:
   行间距=字号×参数

实例:

1.用数字参数设置:

 程序代码
 
<html>

<style type="text/css">
body{font-size:12px;line-height:3px}
</style>
<head>
     <title>CSS</title>
</head>
<body>
     Welcome to Magci's BLOG!<br>
     Welcome to Magci's BLOG!<br>
     Welcome to Magci's BLOG!
</body>
</html>


2.用单位参数设置:
 程序代码

<html>
<style type="text/css">
<!--
    body{font-size:12px;line-height:3px}
-->
</style>
<head>
     <title>CSS</title>
</head>
<body>
     Welcome to Magci's BLOG!<br>
     Welcome to Magci's BLOG!<br>
     Welcome to Magci's BLOG!
</body>
</html>

3.用比例参数设置:
程序代码

<html>
<style type="text/css">
<!--
    body{font-size:12pt;line-height:200%}
-->
</style>
<head>
     <title>CSS</title>
</head>
<body>
     Welcome to Magci's BLOG!<br>
     Welcome to Magci's BLOG!<br>
     Welcome to Magci's BLOG!
</body>
</html>
 

相关文章:

  • 2022-12-23
  • 2021-11-13
  • 2021-05-11
  • 2022-12-23
  • 2021-06-11
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
相关资源
相似解决方案