在css中我们可以利用letter-spacing属性来设置字体间隔,如【letter-spacing:2px;】。letter-spacing属性可以用来增加或减少字符间的空白。
本文操作环境:windows10系统、css 3、@ Q ?thinkpad t480电脑。
letter-spacing 属性增加或减少字s ` [ k P . | | I符间的空白(字符间距)
属性值:
-
normal 默认。规定字符间没有额外的空2 V q J间。
-
l2 } d Z K m \ength 定义字符间的固定空间(允许使用负值)。
-
inherit 规定应该从父元素继承 letter-spacing 属P g 5 Z |性的值。
举个例子:
<!DOCTYPE ht@ 8 $ ^ml> <html>V w l | <head> <meta charset="utf-8">k S P : a x S; <title></d g } _ | K Vtitle> <style> h1 {letter-spacing:2px;} h2 {letter-spacing:-3px;} </styl- D [ L Y Ie> </head> <body> <h1>This is heading 1</h1> <h2>This is heading 2</h2> &$ @ Y ^ Llj . V ) [ 0 C Kt;/body> </html>
运行结果如下所示:
相关推荐:css视频x L –教程
以上就是css怎么设置字体间隔的详细内容,更多请关注php中文网其: % ( J Z ,它相关文章!
声明:本文原创发布phpw y 7中文网,转载请注明出处,C h # ~ \ , 2感谢您的尊重!如有疑问,请联系admin@php.cn处理