In previous versions of CSS, web designers had to use fonts already installed on the user's computer.
Using CSS3, a web designer can use any font he or she likes.
When you find the font file you want to use, simply include the font file in the site and it will be automatically downloaded to the user you want.
In the new @font-face rule, you must first define the name of the font (such as Myfirstfont), and then point to the font file.
<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>CSS Fonts</title> <styletype= "Text/css"> * {margin:0;padding:0; }@font-face{font-family:Myfirstfont;/* Define name * /src:url (' Sansation_light.ttf ');/* point to Text file * / }Div{font-family:Myfirstfont; } </style></Head><Body> <Div>Using CSS3, the website can finally use a pre-selected "legit" font other than the font</Div></Body></HTML>
I downloaded this font file on my computer.
So I quoted the font file that I downloaded in advance on my computer.
(Use a lowercase font when referring to the path URL, and uppercase letters in IE will produce unexpected results)
@font-face { font-family:myfirstfont; Src:url (' Sansation_light.ttf '); /* Reference the lowercase font file */}
The effect is as follows:
Let's compare this to the time when the font file was not referenced before:
css3--fonts