字間距
1、text-indent設置抬頭距離css縮進
即對,對應div設置css樣式text-indent : 20px; 縮進了20px
2、letter-spacing來設置字與字間距_字符間距離,字體間距css樣式
即對對應div設置css屬性樣式為letter-spacing:8px;,字間距為8px
行間距
在CSS中,可以設置行間距,格式如下:
標簽名{line-height:參數}
根據參數不同有3種方法:
1.用數字參數設置:
行間距=字號×參數
2.用單位參數設置:
行間距=參數
3.用比例參數設置:
行間距=字號×參數
實例:
1.用數字參數設置:
程序代碼
<html>
<style type="text/css">
<!--
body{font-size:12pt;line-height:3}
-->
</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:12pt;line-height:3pt}
-->
</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>
