html字体有哪些


本文摘自PHP中文网,作者藏色散人,侵删。

在HTML网页设计中,字体样式的设置是最为基础的。网页中设置合适的字体,可以提高用户体验。那么字体的设置主要用到css中font-family和font-style等字体相关属性。

下面给大家介绍几种常见的HTML字体样式!

代码示例:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

<!DOCTYPE>

<html>

<meta charset="utf-8">

<head>

    <title></title>

    <style type="text/css">

        h2 { color: green; }

 

        #p1 { font-family: Times, "Times New Roman", serif; }

        #p2 { font-family: Helvetica, Arial, sans-serif; }

        #p3 { font-family: serif; }

        #p4 { font-family: sans-serif; }

        #p5 { font-family: monospace; }

        #p6 { font-family: cursive; }

        #p7 { font-family: fantasy; }

 

        .s1 { font-style: italic; }

        .s2 { font-style: oblique; }

        .s3 { font-weight: bold; }

        .s4 { font-weight: 100; }

        .s5 { font-style: normal;}

    </style>

 

</head>

<body>

<h1>字体系列</h1>

<p>与CSS一起使用。两个常见的字体组合列表和五个通用后备字体系列。</p>

一个serif字体家族列表!

<h2>font-family: Times, "Times New Roman", serif</h2>

<p id="p1">

    <span class="s1">斜体字体!</span>

    <span class="s2">字体样式为font-style: oblique; </span>

    <span class="s3">字体样式为font-weight: bold;</span>

    <span class="s4">字体样式为font-weight: 100;</span>

    <span class="s5">正常字体样式!</span>

</p>

一个sans-serif字体家族列表!

<h2>font-family: Helvetica, Arial, sans-serif</h2>

<p id="p2">

    <span class="s1">斜体字体!</span>

    <span class="s2">字体样式为font-style: oblique; </span>

    <span class="s3">字体样式为font-weight: bold;</span>

    <span class="s4">字体样式为font-weight: 100;</span>

    <span class="s5">正常字体样式!</span>

</p>

serif通用字体系列!

<h2>font-family: serif</h2>

<p id="p3">

    <span class="s1">斜体字体!</span>

    <span class="s2">字体样式为font-style: oblique; </span>

    <span class="s3">字体样式为font-weight: bold;</span>

    <span class="s4">字体样式为font-weight: 100;</span>

    <span class="s5">正常字体样式!</span>

</p>

sans-serif通用字体系列!

<h2>font-family: sans-serif</h2>

<p id="p4">

    <span class="s1">斜体字体!</span>

    <span class="s2">字体样式为font-style: oblique; </span>

    <span class="s3">字体样式为font-weight: bold;</span>

    <span class="s4">字体样式为font-weight: 100;</span>

    <span class="s5">正常字体样式!</span>

</p>

等宽通用字体系列!

<h2>font-family: monospace</h2>

<p id="p5">

    <span class="s1">斜体字体!</span>

    <span class="s2">字体样式为font-style: oblique; </span>

    <span class="s3">字体样式为font-weight: bold;</span>

    <span class="s4">字体样式为font-weight: 100;</span>

    <span class="s5">正常字体样式!</span>

</p>

草书字体家族!

<h2>font-family: cursive</h2>

<p id="p6">

    <span class="s1">斜体字体!</span>

    <span class="s2">字体样式为font-style: oblique; </span>

    <span class="s3">字体样式为font-weight: bold;</span>

    <span class="s4">字体样式为font-weight: 100;</span>

    <span class="s5">正常字体样式!</span>

</p>

幻想通用字体系列!

<h2>font-family: fantasy</h2>

<p id="p7">

    <span class="s1">斜体字体!</span>

    <span class="s2">字体样式为font-style: oblique; </span>

    <span class="s3">字体样式为font-weight: bold;</span>

    <span class="s4">字体样式为It sucks in with a 100 font-weight!</span>

    <span class="s5">正常字体样式!</span>

</p>

 

</body>

</html>

前台效果如下图:

阅读剩余部分

相关阅读 >>

html字体有哪些

更多相关阅读请进入《html字体》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...