代码
/*
text-transform用法
*/
.p1 {
/* 默认值 */
text-transform: none;
}
.p2 {
/* 每个单词的首字母大写 */
text-transform: capitalize;
}
.p3 {
/* 全部转换为大写字母 */
text-transform: uppercase;
}
.p4 {
/* 全部转换为小写字母 */
text-transform: lowercase;
} /*
text-decoration用法
*/
.p5 {
/* 默认值 */
text-decoration: none;
}
.p6 {
/* 下划线 */
text-decoration: underline;
}
.p7 {
/* 上划线 */
text-decoration: overline;
}
.p8 {
/* 穿越文本中间的线 */
text-decoration: line-through;
}
.p9 {
/* 去除超链接自带的下划线 */
text-decoration: none;
} /* letter-spacing用法 */
.p10 {
/* 默认值 */
letter-spacing: normal;
}
.p11 {
/* 设置字符间距为10px */
letter-spacing: 10px;
}
.p12 {
/* 设置字符间距为-5px */
letter-spacing: -5px;
} /* word-spacing用法 */
.p13 {
/* 默认值 */
word-spacing: normal;
}
.p14 {
/* 设置字的间距为10px,对中文的效果不明显 */
word-spacing: 10px;
}
.p15 {
/* 设置字的间距为-5px,对中文的效果不明显 */
word-spacing: -5px;
} /* text-align用法 */
.p16 {
/* 水平右对齐 */
text-align: right;
}
.p17 {
/* 水平居中对齐 */
text-align: center;
}
.p18 {
/* 水平两端对齐 */
text-align: justify;
} /* text-indent用法 */
.p19 {
/* 首行缩进20px,第一行会右移20px */
text-indent: 20px;
}
.p20 {
/* 首行缩进-30px,第一行会左移-30px,可以达到隐藏的效果 */
text-indent: -30px;
}
.p21 {
/* 与字体大小配合使用,使首行缩进距离随着字体大小的变化而变化 */
/* 设置字体大小为20px,如果不设置字体大小,默认为16px */
font-size: 20px;
/* 首行缩进距离是字体大小的2倍为40px */
text-indent: 2em;
}
.p22 {
font-size: 20px;
/* 用%设置首行缩进距离,%是基于父元素宽度的百分比的缩进 */
text-indent: 4%;
} <p class="p1">
You Are the Woman I Love Best of All in My LifeHe, a gentleman, was regarded to be the most handsome man in the world, wonderfully urbaneextremely agreeable. His pure eyes and charmingsmile always quivered a network of ripples in thehearts of his fans. He was the charming prince in the dreams of tens of thousands of women and adoredcrazily by them in the last half of the century. His name was Gregory Peck.
</p>
<p class="p2">
You Are the Woman I Love Best of All in My LifeHe, a gentleman, was regarded to be the most handsome man in the world, wonderfully urbaneextremely agreeable. His pure eyes and charmingsmile always quivered a network of ripples in thehearts of his fans. He was the charming prince in the dreams of tens of thousands of women and adoredcrazily by them in the last half of the century. His name was Gregory Peck.
</p>
<p class="p3">
You Are the Woman I Love Best of All in My LifeHe, a gentleman, was regarded to be the most handsome man in the world, wonderfully urbaneextremely agreeable. His pure eyes and charmingsmile always quivered a network of ripples in thehearts of his fans. He was the charming prince in the dreams of tens of thousands of women and adoredcrazily by them in the last half of the century. His name was Gregory Peck.
</p>
<p class="p4">
You Are the Woman I Love Best of All in My LifeHe, a gentleman, was regarded to be the most handsome man in the world, wonderfully urbaneextremely agreeable. His pure eyes and charmingsmile always quivered a network of ripples in thehearts of his fans. He was the charming prince in the dreams of tens of thousands of women and adoredcrazily by them in the last half of the century. His name was Gregory Peck.
</p>
<p class="p5">
嗟夫!予尝求古仁人之心,或异二者之为,何哉?不以物喜,不以己悲;居庙堂之高则忧其民;处江湖之远则忧其君。
</p>
<p class="p6">
嗟夫!予尝求古仁人之心,或异二者之为,何哉?不以物喜,不以己悲;居庙堂之高则忧其民;处江湖之远则忧其君。
</p>
<p class="p7">
嗟夫!予尝求古仁人之心,或异二者之为,何哉?不以物喜,不以己悲;居庙堂之高则忧其民;处江湖之远则忧其君。
</p>
<p class="p8">
嗟夫!予尝求古仁人之心,或异二者之为,何哉?不以物喜,不以己悲;居庙堂之高则忧其民;处江湖之远则忧其君。
</p>
<p>
<a href="#">网易新闻频道(超链接默认自带下划线)</a>
</p>
<p>
<a href="#" class="p9">网易新闻频道(去掉下划线)</a>
</p>
<p class="p10">
You Are the Woman I Love Best of All in My LifeHe, a gentleman, was regarded to be the most handsome man in the world, wonderfully urbaneextremely agreeable. His pure eyes and charmingsmile always quivered a network of ripples in thehearts of his fans. He was the charming prince in the dreams of tens of thousands of women and adoredcrazily by them in the last half of the century. His name was Gregory Peck.
</p>
<p class="p11">
You Are the Woman I Love Best of All in My LifeHe, a gentleman, was regarded to be the most handsome man in the world, wonderfully urbaneextremely agreeable. His pure eyes and charmingsmile always quivered a network of ripples in thehearts of his fans. He was the charming prince in the dreams of tens of thousands of women and adoredcrazily by them in the last half of the century. His name was Gregory Peck.
</p>
<p class="p11">
嗟夫!予尝求古仁人之心,或异二者之为,何哉?不以物喜,不以己悲;居庙堂之高则忧其民;处江湖之远则忧其君。
</p>
<p class="p12">
You Are the Woman I Love Best of All in My LifeHe, a gentleman, was regarded to be the most handsome man in the world, wonderfully urbaneextremely agreeable. His pure eyes and charmingsmile always quivered a network of ripples in thehearts of his fans. He was the charming prince in the dreams of tens of thousands of women and adoredcrazily by them in the last half of the century. His name was Gregory Peck.
</p>
<p class="p12">
嗟夫!予尝求古仁人之心,或异二者之为,何哉?不以物喜,不以己悲;居庙堂之高则忧其民;处江湖之远则忧其君。
</p>
<p class="p13">
You Are the Woman I Love Best of All in My LifeHe, a gentleman, was regarded to be the most handsome man in the world, wonderfully urbaneextremely agreeable. His pure eyes and charmingsmile always quivered a network of ripples in thehearts of his fans. He was the charming prince in the dreams of tens of thousands of women and adoredcrazily by them in the last half of the century. His name was Gregory Peck.
</p>
<p class="p14">
You Are the Woman I Love Best of All in My LifeHe, a gentleman, was regarded to be the most handsome man in the world, wonderfully urbaneextremely agreeable. His pure eyes and charmingsmile always quivered a network of ripples in thehearts of his fans. He was the charming prince in the dreams of tens of thousands of women and adoredcrazily by them in the last half of the century. His name was Gregory Peck.
</p>
<p class="p14">
嗟夫!予尝求古仁人之心,或异二者之为,何哉?不以物喜,不以己悲;居庙堂之高则忧其民;处江湖之远则忧其君。
</p>
<p class="p15">
You Are the Woman I Love Best of All in My LifeHe, a gentleman, was regarded to be the most handsome man in the world, wonderfully urbaneextremely agreeable. His pure eyes and charmingsmile always quivered a network of ripples in thehearts of his fans. He was the charming prince in the dreams of tens of thousands of women and adoredcrazily by them in the last half of the century. His name was Gregory Peck.
</p>
<p class="p15">
嗟夫!予尝求古仁人之心,或异二者之为,何哉?不以物喜,不以己悲;居庙堂之高则忧其民;处江湖之远则忧其君。
</p>
<p>默认水平左对齐</p>
<p class="p16">水平右对齐</p>
<p class="p17">水平居中对齐</p>
<p class="p18">
You Are the Woman I Love Best of All in My LifeHe, a gentleman, was regarded to be the most handsome man in the world, wonderfully urbaneextremely agreeable. His pure eyes and charmingsmile always quivered a network of ripples in thehearts of his fans. He was the charming prince in the dreams of tens of thousands of women and adoredcrazily by them in the last half of the century. His name was Gregory Peck.
</p>
<p class="p19">
嗟夫!予尝求古仁人之心,或异二者之为,何哉?不以物喜,不以己悲;居庙堂之高则忧其民;处江湖之远则忧其君。
</p>
<p class="p20">
嗟夫!予尝求古仁人之心,或异二者之为,何哉?不以物喜,不以己悲;居庙堂之高则忧其民;处江湖之远则忧其君。
</p>
<p class="p21">
嗟夫!予尝求古仁人之心,或异二者之为,何哉?不以物喜,不以己悲;居庙堂之高则忧其民;处江湖之远则忧其君。
</p>
<p class="p22">
嗟夫!予尝求古仁人之心,或异二者之为,何哉?不以物喜,不以己悲;居庙堂之高则忧其民;处江湖之远则忧其君。
</p>
效果

查看源代码

css中一些文本属性的用法的更多相关文章

  1. CSS中的文本属性

    本文总结一下CSS中关于文字的相关属性,最后给出实例. CSS基础文字属性 文字的基础属性主要包括:字体.颜色和文本.除去颜色color的属性外,字体和文本的相关属性可以权威参考: CSS 文本属性( ...

  2. css中table-layout:fixed 属性的用法

    table-layout:fixed 属性的用法:如果想要一个table固定大小,里面的文字强制换行(尤其是在一长串英文文本,并且中间无空格分隔的情况下),以达到使过长的文字 不撑破表格的目的,一般是 ...

  3. CSS中的!important属性用法

    关于CSS的运用技巧有很多, 今天主要探讨一下CSS中 !important 这个属性的用法.在CSS的使用中,遇到最多的问题就是不同浏览器之间的兼容问题. 由于IE并不严格执行W3C标准, 而又几乎 ...

  4. CSS 中关于background 属性功能

    background 是 css中的核心属性,我们对他应该充分了解. background-image   定义背景图像  这个属性是我们用的最多的属性 设置背景图像有两个方式 background: ...

  5. 理解与应用css中的display属性

    理解与应用css中的display属性 display属性是我们在前端开发中常常使用的一个属性,其中,最常见的有: none block inline inline-block inherit 下面, ...

  6. CSS中的display属性(none,block,inline,inline-block,inherit)

    css中的display属性(none,block,inline,inline-block,inherit) display属性是我们在前端开发中常常使用的一个属性,其中,最常见的有: none bl ...

  7. 细说CSS中的display属性

    相信大部分奋战在前端的,尤其在前端攻城的过程中,有一种越陷越深的感觉,不错,一如前端深似海,从此妹子是浮云啊,前端上手容易,深入难啊!下面我就CSS中的display属性讲下我自己所积累的,与大家共享 ...

  8. css中vertical-align和line-height的用法

    css中vertical-align和line-height的用法 1.先来看一种现象: (1).将一个图片放入一个div块中,div块背景颜色设置为aquamarine.将会发现图片与div块下边沿 ...

  9. CSS中使用文本阴影与元素阴影

    文本阴影介绍 在CSS中使用text-shadow属性设置文本阴影,该属性一共有4个属性值如:水平阴影.垂直阴影.(清晰度或模糊距离).阴影颜色. text-shadow属性值说明,在文本阴影实践中: ...

随机推荐

  1. [NOIP2009]最优贸易(图论)

    [NOIP2009]最优贸易 题目描述 CC 国有 \(n\) 个大城市和 \(m\) 条道路,每条道路连接这 \(n\) 个城市中的某两个城市.任意两个城市之间最多只有一条道路直接相连.这 \(m\ ...

  2. nginx-博客阅读笔记记录-20190916

    Nginx 入门学习教程 Ng官网解释: nginx [engine x]是最初由Igor Sysoev编写的HTTP和反向代理服务器,邮件代理服务器和通用TCP / UDP代理服务器. 维基百科解释 ...

  3. DispatcherServlet的工作原理

    下面是DispatcherServlet的工作原理图,图片来源于网络. 下面是我从DispatcherServlet源码层面来分析其工作流程: 1.请求到达后,调用HandlerMapping来查找对 ...

  4. pandas学习(一)

    pandas.DataFrame.sort_index 用法 sort_index(axis=0, level=None, ascending=True, inplace=False, kind='q ...

  5. POJ 3660 Cow Contest ( 最短路松弛思想应用 && Floyd求传递闭包 )

    题意 : 给出 N 头奶牛在比赛的结果,问你最多的能根据给出结果确定其名次的奶牛头数.结果给出的形式为 A  B 代表在比赛当中 A 战胜了 B 分析 : 对于一头奶牛来说,如果我们能确定其他 N - ...

  6. 带有lazy标记的线段树

    #include<bits/stdc++.h> using namespace std; ]; struct st{ int l,r,val,add; }tr[]; void build( ...

  7. Python_006(is和==,小数据池)

    一.is和==的区别 1.id()方法,可以查看一个变量的内存地址 lst = ["周杰伦", "燃哥"] lst1 = ["周杰伦", & ...

  8. C#使用phantomjs 进行网页整页截屏

    C#使用phantomjs 进行网页整页截屏 hantomjs 是一个基于js的webkit内核无头浏览器 也就是没有显示界面的浏览器,这样访问网页就省去了浏览器的界面绘制所消耗的系统资源,比较适合用 ...

  9. Trailing Zeroes (III) -;lightoj 1138

    Trailing Zeroes (III)   PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Y ...

  10. 原来在UNITY中使用system.io下的所有函数都可以用相对路径 : Assets/xx

    代码如下图,这样就不用在绝对路径和相对路径之间不断转换了. 想要得到绝对路径时就傅 Application.dataPath  + xxx using System.Collections; usin ...