亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

CSS3 fonts

@font-face is a module in CSS3. It mainly embeds self-defined Web fonts into your web pages. With the emergence of the @font-face module, we no longer need to use fonts in Web development. No more worries about only using web-safe fonts! Some people will definitely ask, can IE support such a thing? Let me tell you that the @font-face function has been supported as early as IE4. You will definitely be surprised. If you see some English websites or blogs and see some beautiful custom Web fonts, such as the logo on the homepage, Tags and the handwritten English style on the page, in a word these are all implemented by @font-face.


First let’s take a look at the grammatical rules of @font-face:

@font- face {

[font-family: <family-name>;]?

[src: [ <uri> [format(<string>#)]? | < font-face-name> ]#;]?

[unicode-range: <urange>#;]?

[font-variant: <font-variant>;]?

[font-feature-settings: normal|<feature-tag-value>#;]?

[font-stretch: <font-stretch>;]?

[font-weight: <weight>];

[font-style: <style>];

}

Value description:

font-family: Set the font name of the text.

font-style: Set text style.

font-variant: Set whether the text is uppercase or lowercase.

font-weight: Set the thickness of the text.

font-stretch: Set whether the text is stretched horizontally.

font-size: Set the text font size.

src: Set the relative path or absolute path of the custom font. Note that this attribute can only be used in @font-face rules.

Compatible browsers

Speaking of browser compatibility issues with @font-face, this involves a font format issue, because Different browsers have inconsistent support for font formats, so it is necessary for everyone to understand what kind of fonts are supported by various versions of browsers. I briefly mentioned several formats related to fonts earlier. I will talk about them separately below. Question, let everyone have a concept in mind:

1. TrueTpe (.ttf) format:

.ttf font is the most common font in Windows and Mac. It is a RAW format, so It is not optimized for the website. The browsers that support this font include [IE9+, Firefox3.5+, Chrome4+, Safari3+, Opera10+, iOS Mobile Safari4.2+];

2. OpenType (.otf) format :

.otf font is considered to be an original font format. It is built on the basis of TrueType, so it also provides more functions. The browsers that support this font are [Firefox3.5+ , Chrome4.0+, Safari3.1+, Opera10.0+, iOS Mobile Safari4.2+];

3. Web Open Font Format (.woff) format:

.woff The font is the best format among Web fonts. It is a compressed version of open TrueType/OpenType and also supports the separation of metadata packages. The browsers that support this font include [IE9+, Firefox3.5+, Chrome6+, Safari3. 6+, Opera11.1+】;

4. Embedded Open Type (.eot) format:

.eot font is a special font for IE. This format font can be created from TrueType. Browsers that support this font include [IE4+];

5. SVG (.svg) format:

.svg font is a format based on SVG font rendering. Browsers that support this font include [Chrome4+, Safari3.1+, Opera10. 0+, iOS Mobile Safari3.2+].

Note: To implement the browser effects in this section, you need to download the above font format files! ! !

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<style> 
@font-face
{
font-family: myFirstFont;
src: url(sansation_light.woff);
}
@font-face
{
font-family: myFirstFont;
src: url(sansation_bold.woff);
font-weight:bold;
}
div
{
font-family:myFirstFont;
}
</style>
</head>
<body>
<div>
使用CSS3,網(wǎng)站終于可以使用字體以外的預(yù)先選擇“合法”字體。
</div>
<p><b>注意:</b> 需要引入外部字體文件顯示效果。</p>
</body>
</html>


Continuing Learning
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)(php.cn)</title> <style type="text/css"> * {margin:0; padding:0;} body { background-color: #fc0; padding-top: 50px;} ul li { list-style: none;} a { text-decoration: none;} .clear { clear:both;} .layout { width:604px; margin:0 auto;} .layout li { display: block; float: left; border-right: 1px solid #930808; } .layout li.last-child { border-right: none;} .layout li a { display: block; width: 120px; height:120px; line-height: 120px; text-align: center; background-color: #f00;} .layout li a i { color:#fc0;} .layout li a:hover i { color:#fff;} @font-face { font-family: "icomoon"; src:url('fonts/icomoon.eot?-9731bi'); /*↑兼容IE9兼容模式打開IE8及其以下瀏覽器可以顯示;*/ /*↓兼容IE9可以顯示;*/ src:url("fonts/icomoon.eot?#iefix") format("embedded-opentype"), url("fonts/icomoon.woff") format("woff"), url("fonts/icomoon.ttf") format("truetype"), url("fonts/icomoon.svg") format("svg"); /*EOT { 微軟開發(fā)用于嵌入網(wǎng)頁中的字體,IE專用字體; } **WOFF { Web字體中最佳格式,被W3C推薦; } **TTF { 由Microsoft和Apple聯(lián)合開發(fā)的一套字體標(biāo)準(zhǔn),是Mac OS和Win操作系統(tǒng)中最常見的的一種字體; } **SVG { 用于SVG字體渲染的一種格式,是由W3C制定的開放標(biāo)準(zhǔn)的圖形格式; } */ font-weight: normal; font-style: normal; } .icon { font-family: "icomoon"; font-style: normal; font-weight: normal; font-size: 90px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; /*抗鋸齒屬性*/ } </style> </head> <body> <!-- ul.layout>li*5>a[href=#]>i.icon --> <!-- Sublime Text 快捷拼寫 --> <ul class="layout"> <li><a href="#"><i class="icon"></i></a></li> <li><a href="#"><i class="icon"></i></a></li> <li><a href="#"><i class="icon"></i></a></li> <li><a href="#"><i class="icon"></i></a></li> <li class="last-child"><a href="#"><i class="icon"></i></a></li> <div class="clear"></div> </ul> </body> </html>
submitReset Code