加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

使用CSS设置行间距,字间距.

(2012-07-09 14:14:54)
标签:

杂谈

分类: CSS
字间距
1、text-indent设置抬头距离css缩进
http://www.divcss5.com/uploads/allimg/100321/1_100321083522_1.png
即对,对应div设置css样式text-indent : 20px; 缩进了20px

2、letter-spacing来设置字与字间距_字符间距离,字体间距css样式
http://www.divcss5.com/uploads/allimg/100321/1_100321083643_1.png
即对对应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>


0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有