博客
关于我
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/

你可能感兴趣的文章
php curl 实例+详解
查看>>
php curl_init函数用法(http://blog.sina.com.cn/s/blog_640738130100tsig.html)
查看>>
php curl_multi批量发送http请求
查看>>
php curl请求微信发红包接口出现错误:Peer's Certificate issuer is not recognized.
查看>>
PHP curl请求错误汇总和解决方案
查看>>
php declare(ticks=1)
查看>>
UVA 10474
查看>>
php echo 输出 锘?... 乱码问题
查看>>
PHP empty、isset、isnull的区别
查看>>
ReferenceQueue的使用
查看>>
PHP FastCGI进程管理器PHP-FPM的架构
查看>>
referenceQueue用法
查看>>
Springboot处理跨域的方式(附Demo)
查看>>
php flush()刷新不能输出缓冲的原因分析
查看>>
Referenced classpath provider does not exist: org.maven.ide.eclipse.launchconfig
查看>>
Refactoring-Imporving the Design of Exsiting Code — 代码的坏味道
查看>>
PHP imap 远程命令执行漏洞复现(CVE-2018-19518)
查看>>
php include和require
查看>>
ref 和out 区别
查看>>
php JS 导出表格特殊处理
查看>>