博客
关于我
font
阅读量:492 次
发布时间:2019-03-07

本文共 622 字,大约阅读时间需要 2 分钟。

■ 定义

font属性是CSS中的复合属性,用于同时控制字体的多个方面,如样式、高度、大小和字体家族等。它能够以单一属性替代多个单独的CSS属性,从而减少代码冗余

■ 语法使用方法

font属性的值必须按照以下顺序书写,各属性之间用空格隔开,且顺序不可变换:font-style font-weight font-size/line-height font-family

font: font-style font-weight font-size/line-height font-family;

如果某些属性不需要设置,可以省略,浏览器会使用默认值。不过必须保留font-size和font-family属性,否则font属性将失效

■ 示例说明

div { font: italic 700 16px 'Microsoft YaHei'; }

p { font: 16px 'Microsoft YaHei'; }

div { font: bold 20px Arial, sans-serif; }

p { font: 14px Arial, sans-serif; }

(以上代码示例显示了如何设置不同元素的字体样式,确保所有属性按顺序书写)

转载地址:http://uqncz.baihongyu.com/

你可能感兴趣的文章
Python setup.py:数据文件无法复制目录:不存在或不是常规文件
查看>>
Python setuptools sdist:仅安装版本化文件
查看>>
Python Shell下使用matplotlib
查看>>
Python Slice How-to,我知道Python Slice,但我怎么才能使用内置的Slice对象呢?
查看>>
python socket分包发送数据
查看>>
python socket模块_Python socket模块实现TCP服务端客户端
查看>>
Python SOCKS5代理客户端HTTPS
查看>>
Python Soc网络分析:通过使用函数迭代列表来计算机会网络
查看>>
Python SQL和NoSQL数据库操作实战
查看>>
python stdout flush_sys.stdout.flush()方法的用法
查看>>
python string 运算
查看>>
Python str与bytes之间的转换
查看>>
Python subprocess ffmpeg
查看>>
python subprocess Permission denied Errno 13
查看>>
Python subprocess.call - 将变量添加到 subprocess.call
查看>>
Python Subprocess.Popen 从一个线程
查看>>
Python subprocess.Popen 作为 Windows 上的不同用户
查看>>
Python subprocess.Popen() 等待完成
查看>>
Python Sympy模块NoConversion:收敛到根失败;请尝试n<;15或MaxSteps>;50
查看>>
python time模块
查看>>