使用css控制文本不常使用的属性总结

1、text-transform

.font01{
	font-family:"幼圆";
	font-weight:bold;
	line-height:30px;//控制行文本间距
	text-align:center;//元素的水平对齐方式
    text-transform:uppercase; //有3个属性:capitalize(首字母大写),uppercase(全部大写),lowercase(全部小写)
}

2、text-decoration:

underline:为文字定义下划线
overline:为文字定义顶划线
line-throgh:为文字定义删除线

3、letter-spacing:定义两个文字之间的距离,单位em

4、首字下沉:为第一个字单独设置样式实现的,如:

.font01{
	font-size:24px;
	float:left;
}

5、首航缩进:text-indent

6、段落水平对齐:text-align [ left,center,right,justify(两端分散对齐) ]

7、段落垂直对齐:vertical-align

8、文字阴影:text-shadow,效果演示:http://www.w3school.com.cn/tiy/t.asp?f=css3_text-shadow

#text{
	width:480px;
	height:136px;
	font-size:14px;
	background-image:url(../images/43405.png);
	background-repeat:no-repeat;
	background-position:left center;
	margin-top:50px;
	padding-left:463px;
	line-height:25px;
	text-shadow: 3px 3px 3px #999999;
}

9、文本换行:word-wrap:normal(连续换行)或break-word(边界内换行)

10、控制文本溢出:text-overflow,将页面中过长的信息省略显示。

w3c在线演示:http://www.w3school.com.cn/tiy/t.asp?f=css3_text-overflow

#text01{
	width:360px;
	height:170px;
	padding-top:30px;
	padding-bottom:30px;
	white-space: nowrap;
	overflow:hidden;
	text-overflow:ellipsis;//表示显示省略标记(...),如果是cli则不显示省略标记,只是简单的剪切
}

 

转载于:https://my.oschina.net/u/2391658/blog/918587

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值