服务器端字体和@font-face属性

服务器端字体和@font-face属性

@font-face{
font-family:webFont;
src:url('font/字体名称.otf)format(“opentype”);
}

字体格式字体属性
otfopentype
ttftruetype
eotembedded-opentype

1.font-family
设置文本的字体名称

2.font-style
设置文本样式
normal不适用斜体
static使用斜体
oblique使用倾斜体
inherit从父元素继承

3. font-variant
设置文本是否大小写
normal使用浏览器默认值
small-caps使用小型大写字母
inherit从父元素继承

4.font-weight
设置文本粗细
normal浏览器默认值
bold粗体
bolder更粗
lighter更细
100-900从细到粗

5.font-stretch
设置文本是否横向拉伸变形
normal正常文字宽度
wider把伸展比例设置为更进一步的伸展值
narrower把收缩比例设置为更进一步的收缩值
ultra-condensed比正常文字宽度窄4个基数
extra-condensed比正常文字宽度窄3个基数
condensed比正常文字宽度窄2个基数
semi-condensed比正常文字宽度窄1个基数
semi-expanded比正常文字宽度宽1个基数

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>服务器端字体和@font-face属性</title>
    <style type="text/css">

       @font-face {
           font-family: webfont;
           src: url(毛泽东字体.ttf);
       }

       h1{
           font-family: webfont;
           font-style: oblique;
           font-size: 50px;
       }

       h2{
           font-variant: small-caps;
           font-weight: lighter;
           
       }
    

    </style>
</head>
<body>
   <h1>魔道祖师</h1>
   <h2>master devil</h2>
   
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

uncle_Huang

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值