zoukankan      html  css  js  c++  java
  • 使用CSS设置行间距,字间距.

    字间距
    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>
  • 相关阅读:
    钾 动态规划
    镁 细节
    锌 填坑计划
    钠 GZY整理贪心
    javascript+Java 实现MD5加密登录密码
    FCKeditor2.6.4图片上传,中文名乱码,红叉各种问题解决
    Java 随机生成验证码,支持大小写字母、数字、随机字体
    BI BI系统监控
    使用ETL控件还是存储过程
    fsync与数据库日志刷新
  • 原文地址:https://www.cnblogs.com/cuidan9495/p/6042486.html
Copyright © 2011-2022 走看看