< code><html>
<head>
<meta charset< /span>='utf-8'>
<title>CSS font style attribute</ title>
</head>
<body>
<p class='part1'> I set it to Microsoft Yahei, 18 pixels, oblique, bold red font </p>
<p class='part2' > I am using the server font defined by the @font-face attribute, which is displayed as a 24-pixel blue font </ p>
</body>
</ html>
2, definition CSSstyle
Use the embeddedCSSstyle sheet to style the page, specificallyCSSThe code is as follows:
- < li>
<style type='text/css'>
@font-face{
font-family: ziti; /*server font name*/
src:url(font/FZJZJW.TTF); /*server font name*/
}
.part1{
font-family:'Microsoft Yahei';
< span class='code-snippet_outer'> font-size:18px;
color:red;
font-style:italic;
font-weight:bold;
}
.part2{
font-family:ziti; /*Set font style*/
< span class='code-snippet_outer'> font-size:24px;
color:blue;
}
</style< /span>>
After saving, preview it in Google Chrome, the effect is as shown in the figure3-10.
Figure 3-1 span>CSSfont style Attribute Effect
Articles are uploaded by users and are for non-commercial browsing only. Posted by: Lomu, please indicate the source: https://www.daogebangong.com/en/articles/detail/Styling%20text%20with%20CSS.html
评论列表(196条)
测试