HTML 字体参考

时间:2019-06-08 23:19:24  来源:igfitidea点击:

字体是特定于平台的。在运行不同操作系统(如Windows、Linux或macios)的不同机器上,我们将拥有不同的网页外观。这里我们给出了各种操作系统中可用的字体列表。

HTML<font>标记在4.0以后的版本中被弃用,现在所有字体都是通过CSS设置的。

以下是设置网页正文字体的简单语法。

body {
   font-family: "new century schoolbook";
}  

或者

<body style = "font-family:new century schoolbook;">

示例

<!DOCTYPE html>
<html>

   <head>
      <title>设置字体</title>
   </head>

   <body>
      <div style = "font-family:verdana;">设置字体集</div>
      <br />
      
      <div style = "font-size:120%;">设置字体大小</div>
      <br />
      
      <div style = "font-size:14pt;">设置字体大小</div>
   </body>

</html>

微软系统字体

默认系统自带的字体列表:
https://docs.microsoft.com/en-us/typography/fonts/windows_10_font_list

常用字体:

字体字体字体
'Arial''Arial Black''Bahnschrift'
'Calibri''Cambria''Cambria Math'
'Candara''Comic Sans MS''Consolas'
'Constantia''Corbel''Courier New'
'Ebrima''Franklin Gothic Medium''Gabriola'
'Gadugi''Georgia''HoloLens MDL2 Assets'
'Impact''Ink Free''Javanese Text'
'Leelawadee UI''Lucida Console''Lucida Sans Unicode'
'Malgun Gothic''Marlett''Microsoft Himalaya'
'Microsoft JhengHei''Microsoft New Tai Lue''Microsoft PhagsPa'
'Microsoft Sans Serif''Microsoft Tai Le''Microsoft YaHei'
'Microsoft Yi Baiti''MingLiU-ExtB''Mongolian Baiti'
'MS Gothic''MV Boli''Myanmar Text'
'Nirmala UI''Palatino Linotype''Segoe MDL2 Assets'
'Segoe Print''Segoe Script''Segoe UI'
'Segoe UI Historic''Segoe UI Emoji''Segoe UI Symbol'
'SimSun''Sitka''Sylfaen'
'Symbol''Tahoma''Times New Roman'
'Trebuchet MS''Verdana''Webdings'
'Wingdings''Yu Gothic'

Macintosh系统的字体

以下是Macintosh System 7及更高版本支持的字体列表

https://developer.apple.com/fonts/system-fonts/

字体字体字体
'American Typewriter''Andale Mono''Arial'
'Arial Black''Arial Narrow''Arial Rounded MT Bold'
'Arial Unicode MS''Avenir''Avenir Next'
'Avenir Next Condensed''Baskerville''Big Caslon'
'Bodoni 72''Bodoni 72 Oldstyle''Bodoni 72 Smallcaps'
'Bradley Hand''Brush Script MT''Chalkboard'
'Chalkboard SE''Chalkduster''Charter'
'Cochin''Comic Sans MS''Copperplate'
'Courier''Courier New''Didot'
'DIN Alternate''DIN Condensed''Futura'
'Geneva''Georgia''Gill Sans'
'Helvetica''Helvetica Neue''Herculanum'
'Hoefler Text''Impact''Lucida Grande'
'Luminari''Marker Felt''Menlo'
'Microsoft Sans Serif''Monaco''Noteworthy'
'Optima''Palatino''Papyrus'
'Phosphate''Rockwell''Savoye LET'
'SignPainter''Skia''Snell Roundhand'
'Tahoma''Times''Times New Roman'
'Trattatello''Trebuchet MS''Verdana'

Unix系统字体

以下是大多数Unix系统变体支持的字体列表

字体字体字体
CharterCleanCourier
FixedHelveticaLucida
Lucida brightLucida TypewriterNew Century Schoolbook
SymbolTerminalTimes

HTML ASCII码

共有128个可打印字符,可由不同的7位ASCII码表示。另一组字符不是用来表示HTML的,而是用来控制硬件的。

下表列出了所有7位ASCII代码及其等效的HTML实体代码。

7位可打印ASCII字符

ASCII字符说明HTML实体代码
空格&#32;
!感叹号&#33;
"引号&#34;
#井号&#35;
$美元符号&#36;
%百分号&#37;
&与号&#38;
'单引号&#39;
(左括号&#40;
)右括号&#41;
*星号&#42;
+加号&#43;
,逗号&#44;
-连字符&#45;
.&#46;
/斜杠&#47;
0数字0&#48;
1数字1&#49;
2数字2&#50;
3数字3&#51;
4数字4&#52;
5数字5&#53;
6数字6&#54;
7数字7&#55;
8数字8&#56;
9数字9&#57;
:冒号&#58;
;分号&#59;
<小于&#60;
=等于&#61;
>大于&#62;
?问号&#63;
@艾特符号&#64;
A大写字母A&#65;
B大写字母B&#66;
C大写字母C&#67;
D大写字母D&#68;
E大写字母E&#69;
F大写字母F&#70;
G大写字母G&#71;
H大写字母H&#72;
I大写字母I&#73;
J大写字母J&#74;
K大写字母K&#75;
L大写字母L&#76;
M大写字母M&#77;
N大写字母N&#78;
O大写字母O&#79;
P大写字母P&#80;
Q大写字母Q&#81;
R大写字母R&#82;
S大写字母S&#83;
T大写字母T&#84;
U大写字母U&#85;
V大写字母V&#86;
W大写字母W&#87;
X大写字母X&#88;
Y大写字母Y&#89;
Z大写字母Z&#90;
[左方括号&#91;
\反斜杠&#92;
]右方括号&#93;
^脱字符号&#94;
_下划线&#95;
`重音符&#96;
a小写字母a&#97;
b小写字母b&#98;
c小写字母c&#99;
d小写字母d&#100;
e小写字母e&#101;
f小写字母f&#102;
g小写字母g&#103;
h小写字母h&#104;
i小写字母i&#105;
j小写字母j&#106;
k小写字母k&#107;
l小写字母l&#108;
m小写字母m&#109;
n小写字母n&#110;
o小写字母o&#111;
p小写字母p&#112;
q小写字母q&#113;
r小写字母r&#114;
s小写字母s&#115;
t小写字母t&#116;
u小写字母u&#117;
v小写字母v&#118;
w小写字母w&#119;
x小写字母x&#120;
y小写字母y&#121;
z小写字母z&#122;
{左花括号&#123;
|竖线&#124;
}右大括号&#125;
~波浪号&#126;

7位ASCII设备控制字符

ASCII字符英文全拼说明HTML实体代码
NULnull characternull字符&#00;
SOHstart of header头开始&#01;
STXstart of text开始的文本&#02;
ETXend of text最后的文本&#03;
EOTend of transmission传输结束&#04;
ENQenquiry询盘&#05;
ACKacknowledge承认&#06;
BELbell (ring)贝尔(环)&#07;
BSbackspace退格&#08;
HThorizontal tab水平选项卡&#09;
LFline feed换行&#10;
VTvertical tab垂直制表符&#11;
FFform feed换页&#12;
CRcarriage return回车&#13;
SOshift out移出&#14;
SIshift in移入&#15;
DLEdata link escape数据链路转义&#16;
DC1device control 1设备控制1&#17;
DC2device control 2设备控制2&#18;
DC3device control 3设备控制3&#19;
DC4device control 4设备控制4&#20;
NAKnegative acknowledge否定应答&#21;
SYNsynchronize同步&#22;
ETBend transmission block结束传动块&#23;
CANcancel取消&#24;
EMend of medium媒体结束&#25;
SUBsubstitute替代&#26;
ESCescape转义&#27;
FSfile separator文件分隔符&#28;
GSgroup separator组分隔符&#29;
RSrecord separator记录分隔符&#30;
USunit separator单位分隔符&#31;
DELdelete (rubout)删除&#127;