教程推荐:css视频教程
CSS字体属性定义文本的字体系列、大小、加粗、风格(如斜体)和变形(如小型大写字母)font-family控制字体,由于各个电脑系统安装的字体不尽相同,但是基本装有黑体、宋体与微软雅黑这三款字体。
font-size
控制字体大小,我们设置字体大小是设置它的宽度,它的高度一般电脑系统默认字体大小是16px,所以字体大小尽量不要低于16px,1em=16px;
font-weight: bold;
/*控制字重 一般是100-900 常用lighter(细体) normal(正常)bold加粗 */
至于这个font-style
,一般默认是normal,也就是正常的,如果说你设置 font-style: italic;斜体话,其实和这个907fae80ddef53131f3292ee4f81644bd1c6776b927dc33c5d9114750b586338的效果是差不多的;文字间的间距用的line-height如果和高度相等话,就是垂直居中了。
通常font字体的简写:font:style weight size/line-heigt font-family /*要求必须出现的2个是 size与font-family*/
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>css常用样式font字体的多种变换</title> <style> div{ font-family: 'Microsoft YaHei';/*微软雅黑*/ /* font-family: 'Lucida Sans','Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; */ /*字体加上双引号或者单引号,当有多个字体的时候,中间逗号分开*/ color:#f90; font-size: 24px;/*控制字体大小*/ font-weight: bold; /*控制字重 常用lighter(细体) normal(正常)bold加粗 */ font-style: italic;/*等同于em*/ line-height: 30px; } /*font字体的简写:font:style weight size/line-heigt font-family*/ /*要求必须出现的2个是 size font-family*/ p{ font: 24px/1.5em 'Lucida Sans','Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; letter-spacing: 1px;/*英文字母间距*/ word-spacing: 10px;/*英文单词间距*/ } P::first-letter{ text-transform: capitalize; }/*第一个字母::first-letter*/ p::first-line{ color:red; }/*第一行::first-line*/ </style> </head> <body> <div>技术为王世界,欲问青天山顶景色是否独好技术为王世界, 欲问青天山顶景色是否独好技术为王世界,欲问青天山顶景色是否独好技术为王世界, 欲问青天山顶景色是否独好技术为王世界,欲问青天山顶景色是否独好技术为王世界, 欲问青天山顶景色是否独好技术为王世界, 欲问青天山顶景色是否独好技术为王世界,欲问青天山顶景色是否独好 </div> <p>Technology is king world, I want to ask if the scenery on the top of Qingtian Mountain is the king of technology, I want to ask whether the scenery of Qingtian Peak is the king of technology. If the technology is the king of the world, I would like to ask whether the scenery on the top of Qingtian Mountain is the king of the world. Is the scenery good?</p> </body> </html>
关于样式继承问题/*与文字有关样式会被继承下去*/代码展示如下:
<!doctype html> <html> <head> <meta charset="UTF-8"> <title>index</title> <style> p{ font-size: 20px; font-family: 微软雅黑; color:#f00; font-weight:bold; font-style:italic; word-spacing:15px; } </style> </head> <body> <div> <p><span>linux php linux</span></p> <p><span>linux linux php linux</span></p> <p><span>linux linux php linux</span></p> <p><span>linux linux php linux</span></p> </div> </body> </html>
更多编程相关知识,请访问:编程教学!!
以上是css font控制字体的多种变换的详细内容。更多信息请关注PHP中文网其他相关文章!

@keyframesispopularduetoitsversatoryand and powerincreatingsmoothcssanimations.keytricksinclude:1)definingsmoothtransitionsbetnestates,2)使用AnimatingmatematingmultationmatingMultationPropertiessimultane,3)使用使用4)使用BombingeNtibalibility,4)使用BombingingWithjavofofofofofoffo

CSSCOUNTERSAREDOMANAGEAUTOMANAMBERINGINWEBDESIGNS.1)他们可以使用forterablesofcontents,ListItems,and customnumbering.2)AdvancedsincludenestednumberingSystems.3)挑战挑战InclassINCludeBrowsEccerCerceribaliblesibility andperformiballibility andperformissises.4)创造性

使用滚动阴影,尤其是对于移动设备,是克里斯以前涵盖的一个微妙的UX。杰夫(Geoff)涵盖了一种使用动画限制属性的新方法。这是另一种方式。

文章讨论了CSS FlexBox,这是一种布局方法,用于有效地对齐和分布响应设计中的空间。它说明了FlexBox用法,将其与CSS网格进行了比较,并详细浏览了浏览器支持。

本文讨论了使用CSS创建响应网站的技术,包括视口元标签,灵活的网格,流体媒体,媒体查询和相对单元。它还涵盖了使用CSS网格和Flexbox一起使用,并推荐CSS框架


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

Atom编辑器mac版下载
最流行的的开源编辑器

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

SublimeText3汉化版
中文版,非常好用

SublimeText3 Linux新版
SublimeText3 Linux最新版

VSCode Windows 64位 下载
微软推出的免费、功能强大的一款IDE编辑器