zoukankan      html  css  js  c++  java
  • 【CSS3】文本属性

     1 <!DOCTYPE html>
     2 <html>
     3 <head>
     4     <meta charset="utf-8">
     5     <title></title>
     6     <link rel="stylesheet" type="text/css" href="style.css">
     7 </head>
     8 <body>
     9     <p id="p1">text-align文本水平对齐方式</p>
    10     <p>This    is     a    test    sentence.   汉字    之间    无     空格     会     当作     一个     单词。    </p>
    11     <p id="p3">abcdqwert yuiopasdfg hjklzxcvbn mnqwertyuioqwe rtyuiasdf ghjzxcvb qwetyuasdfg hzxcv bnasdfgh qwerty uwertyusdfghxcvb qwertyusdfghxcvbnoqwertyuioasdfghjklzxcvbnm</p>
    12     <p id="p4">abcdqwert yuiopa sdfghjklzx cvbnmnqwe rtyuioqwerty uiasdfghjzxcvb qwetyuas dfghzxcvbnasdfg hqwertyuwe rtyusd fghxcvbqwertyusdfghxcvbnoqwerty uioasdfghjklzxcvbnm</p>
    13     <p id="p5">abcdqwert yuiopa sdfghjklzx cvbnmnqwe rtyuioqwerty uiasdfghjzxcvb qwetyuas dfghzxcvbnasdfg hqwertyuwe rtyusd fghxcvbqwertyusdfghxcvbnoqwerty uioasdfghjklzxcvbnm</p>
    14     <h1>h1标签内容</h1>
    15 </body>
    16 </body>
    17 </html>
     1 /*#p1{*/
     2     /*text-align: justify;*//*默认left,可设right、center、justify、start、end*/
     3     /*line-height: 3;*//*设置行高:normal、数字、百分比、px、em*/
     4     /*text-indent: 20px;*//*设置首行缩进:像素、百分比、em*/
     5     /*text-decoration:line-through overline underline;*//*默认值none在超链接去掉默认下划线时可用到,下划线underline,上划线overline,删除线line-through,闪烁文本blink*/
     6     /*letter-spacing: 2em;*//*设置字符间距,默认normal,可用像素、em,可设负值*/
     7     /*}*/
     8 p{
     9     /*word-spacing: 2em;*//*类似letter-spacing,可设负值*/
    10     /*text-transform: lowercase;*//*none默认;capitalize每个单词以大写字母开头,uppercase转换为大写字母,lowercase转换为小写字母*/
    11     /*text-shadow: 3px 3px 3px red, -6px -6px 3px green;*//*四个参数:横向偏移、纵向偏移、模糊度、颜色,可加多个阴影用逗号隔开*/
    12     /*white-space: pre;*//*设置元素中空白处理方式:默认normal;pre空白会保留,类似pre标签;nowrap文本不会换行,文本会在同一行上继续,直到遇到br标签为止;pre-wrap保留空白正常换行;pre-line合并空白正常换行*/
    13     /*direction: rtl;*//*默认ltr*/
    14     /*unicode-bidi: bidi-override;*//*从右向左读文字,一般配合direction使用,默认normal,可设embed*/    
    15 }
    16 #p3{
    17     background: green;
    18     width: 200px;
    19     word-wrap: break-word;
    20 }
    21 #p4{
    22     background: blue;
    23     width: 200px;
    24     word-wrap: ;
    25 }
    26 #p5{
    27     background: red;
    28     width: 200px;
    29     word-break: break-all;/*比work-wrap的break-word拆的更彻底。keep-all只能在半角空格或连字符处换行*/
    30 }
    31 h1{
    32     -webkit-text-stroke:1px red;/*多数浏览器不支持此功能,所以要加浏览器私有前缀-webkit-*/
    33     -webkit-text-fill-color:blue;
    34 }
    35 /*text-overflow设置是否使用一个省略标记...标示对象内文本溢出:clip默认值,当对象内文本溢出时不显示省略标记,而是将溢出部分裁掉;ellipsis当对象内文本溢出时显示省略号。此属性要和over-flow:hidden属性,white-space:nowrap配合使用。*/
    36 /*
    37 text-outline规定文本的轮廓;
    38 text-justify规定当text-align设置为justify时所使用的对齐方式;
    39 text-align-last设置如何对齐最后一行或紧挨强制换行符之前的行;
    40 text-emphasis向元素的文本应用重点标记以及重点标记的前景色;
    41 hanging-punctuation规定标点字符是否位于线框之外;
    42 punctuation-trim规定是否对标点字符进行修剪;
    43 tab-size设定一个tab在页面中的显示长度;
    44 text-wrap规定文本的换行规则。
    45 */
  • 相关阅读:
    oracle添加字段,备注
    oracle对日期date类型操作的函数
    查询效率例子收藏
    webuploader.min.js 简单例子
    select 数字/字符串/count(参数)/sum(数字) from table
    oracle常用分析函数 over(partition by xxx order by xxx)
    LigerUi遮罩的两个方法
    LigerUI子父窗口之间传参问题
    LigerUi自动检索输入
    LigerUi折叠与展开
  • 原文地址:https://www.cnblogs.com/xiongjiawei/p/6752791.html
Copyright © 2011-2022 走看看