方法:1、利用font標簽將需要設(shè)置字體的文本包裹起來,語法為“<font>文本</font>”;2、利用font標簽的face屬性將字體設(shè)置為楷體即可,語法為“<font face=\”楷體\”>文本</font>”。
本教程操作環(huán)境:windows10系統(tǒng)、html5版、dell g3電腦。
html5怎樣將字體設(shè)置為楷體
在html中,想要將字體設(shè)置為楷體,可以利用font標簽,以及font標簽的face屬性。
<font>用于規(guī)定文本的字體、字體尺寸、字體顏色。
font標簽的face屬性font 元素中文本的字體。
示例如下:
<!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>document</title></head><body><h1><font face=\”楷體\”>楷體樣式</font></h1></body></html>
輸出結(jié)果:
推薦教程:《html視頻教程》