首页 > Web开发 > 详细

CSS文本

时间:2020-04-11 22:51:08      阅读:82      评论:0      收藏:0      [点我收藏+]

color文字颜色

color: pink;

text-align对齐

text-align: left(right, center);

div默认宽度=100%,文本可以对齐

span默认宽度=文本的宽度

文本已经定在其边框上了,对齐是看不出来效果的。

text-decoration文本修饰

text-decoration: overline;上划线

text-decoration: line-through;删除效果

text-decoration: underline;下划线

text-decoration: blink;大部分浏览器已经取消闪烁效果

text-decoration: none;可以去掉超链的下划线

line-height行间距

数字或者百分比

默认行间距

默认行间距

 

200%行间距

 

200%行间距

letter-spacing字符间距

  数字

word-spacing单词间距

  数字

默认:abcdefg abcdefg abcdefg

效果:a b c d e f g  a b c d e f g

text-indent首行缩进

  数字

默认:abcdefg abcdefg abcdefg

效果:abcdefg   abcdefg

text-transform大小写

  text-transform: uppercase;

  text-transform: capitalize;

  text-transform: lowercase;


 

空白格white-space

white-space: normal;

  • 你管我嘞!不管你怎么要空格或者回车,我只给你一个空格!(多个空白格或者换行符会被合并成一个空白格)

white-space: pre;

  • pre诚不欺我!不顾爸爸的约束也给你办!(有多少空白格,显示多少空白格,相当于pre标签,如果长度超出父容器也不会换行

white-space: pre-wrap;

  • pre-wrap(有多少空白格,显示多少空白格,相当于pre标签,如果长度超出父容器,会换行

white-space: nowrap;

  • 没有包裹!不顾爸爸的约束,我能一马平川,直到遇见br才从头来。(一直不换行,直到使用br)

CSS文本

原文:https://www.cnblogs.com/heyan/p/12682622.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!