如果说只是单纯的一个html页面是没有任何色彩的,我们通常需要添加一些css,js样式来增加页面的色彩感,下面我们来说一下有关css文字方面的样式。
字体
body{font-family:"宋体";}
颜色
body{color:#666}
大小
body{font-size:12px;}body{font-size:1em;}
缩进
立即学习“前端免费学习笔记(深入)”;
p {text-indent: 2em;}p {text-indent: 50%;} //基于父元素
字体风格
p.normal {font-style:normal;}//默认p.italic {font-style:italic;}// 斜体p.oblique {font-style:oblique;}// 倾斜
对其方式
h1{text-align:center;}
值:left、right、center、justify
字间距
p{word-spacing:25px;}p{word-spacing:normal;}// 相当与0px
字母间距
h1 {letter-spacing:2px;}h1 {letter-spacing:normal;}
字符转换
h1 {text-transform: none;}//默认h1 {text-transform: capitalize;}//首字母大写h1 {text-transform: uppercase;}// 全部大写h1 {text-transform: lowercase;}// 全部小写
文本修饰
a {text-decoration: none;}h1 {text-decoration:overline}//上划线h2 {text-decoration:line-through}//中划线h3 {text-decoration:underline}// 下划线// blink闪烁文本,不过兼容性不好,很多浏览器都不支持
粗体
p.normal {font-weight:normal;}p.thick {font-weight:bold;}//粗体p.bolder{font-weight:bolder;}// 更粗p.lighter{font-weight:lighter;}// 更细p.thicker {font-weight:900;}//400 等同于 normal,而 700 等同于 bold。
以上是目前常用的一些CSS文字样式,希望能够给大家一些帮助。
相关文章:
必须掌握的CSS文字样式
实现css文字飞入效果示例代码
以上就是CSS文字的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/1609908.html
微信扫一扫
支付宝扫一扫