CSS文字样式

font-family 选择字体样式,使字体看起来比较美观:

	<style type="text/css">
	.family{font-family: "Microsoft Yahei"}
	</style>

与普通文字对比,可以看出有细微差别,还有许多字体的样式,不过想别人看到字体样式必须别人的电脑上也安装了相对应的字体样式,想看看有多少个样式可以查查万能的百度



font-weight 字体加粗

	<style type="text/css">
	.weight{font-weight: bold;}
	</style>

其他参数有normal,正常粗细,lighter更细,bolder更粗



font-size 字体大小

	<style type="text/css">
	.size{font-size: 30px;}
	</style>

font-size后面加像素px,具体自行测试大小



font-style 字体风格

	<style type="text/css">
	.normal {font-style:normal;}
	.italic {font-style:italic;}
	.oblique {font-style:oblique;}
	</style>



text-decoration 字体装饰

	<style type="text/css">
	.underline{text-decoration:underline;}
	.through{text-decoration: line-through;}
	</style>

还有其他的文字装饰,可以到网上查查



text-indent段落缩进

	<style type="text/css">
	.indent{text-indent: 2em;}
	</style>

一个em等于一个字体大小,2em代表缩进两个字体·



letter-spancing 字母间隔   word-spacing 单词间隔

	<style type="text/css">
	.letter{letter-spacing: 10px;}
	.word{word-spacing: 10px;}
	</style>



line-height 行高

	<style type="text/css">
	.height{line-height: 2em;}
	</style>

2em表示两个字体的距离,行高是从上一行字体开始算的,第一行算1em,第二行空行算1em,如果填0em的话所有的字体会叠加在一起。



text-align对块状的文本图片的位置放置

text-align:center 水平居中

text-align:left 水平居左 

text-align:right 水平居




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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值