In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces the knowledge of "how to call the font according to the font name to let the browser display the font you want". In the actual case operation, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations! I hope you can read it carefully and be able to achieve something!
Question 1: how do you instruct the browser to display the font you want? Just type the name of the font after the font?
Unfortunately, it's not that simple, and the names of fonts on different operating platforms may change. For example, Courier is called COurier New on MAC. A font that may be called Italic on one machine may be called Oblique on another machine. You study carefully.
More such examples will be found later.
Therefore, the name we call a font is not necessarily the name of the font given by the computer. And you have to make sure that the font name you use is the font name of the computer.
So how do you determine the exact name of a font by the computer? It depends on the operating platform used by the computer.
Windows users: use the exact font names listed in the font menu in applications such as word.
Mac users: don't trust the font names listed by the app. Instead, open your system folder and use the font name in your stylesheet according to the spelling in it.
Font series
Font series is the name of a font in CSS.
Sex. Its basic syntax is as follows:
The code is as follows:
H2 {font-family: helvetica
Impact, sans-serif}
Here are the rules for Web browsers to interpret stylesheets: first look for the name of the font (helvetica) in the list and use it if the font is installed on the computer. If not installed, move to the next font (impact), and if this font is not installed, move to the third font (sans-serif). The sans-serif font parameter is the last parameter that the browser can rely on, and it tells the browser to use any default sans-serif font (or Arial).
The following is the actual display of the browser you use:
CSS font control is peachy.
You can add any font name to the list. This is a good way to do this when you are not sure about the name of a font on different operating platforms. Note: browsers tend to recognize lowercase names. Of course, as long as you have tested all the projects, there will be no problem.
It is a good practice to list one generic font at a time as the last option in the font list. You can choose from the following:
Serif (or maybe Times)
Sans-serif (it could also be Arial or Helvetica)
Cursive (or maybe Comic Sans)
Fantasy (or maybe Ransom)
Monospace (or maybe Courier)
(note: Netsacpe Communicator does not support Cursive or fantasy)
Tips for other font names:
If a font has more than one word, such as Gill Sans, include the font name in quotation marks in your CSS code.
BODY {font-family: "gill sans", "new baskerville", serif}
CSS rules added in the line, using single quotation marks:
The code is as follows:
Text
Goes here.
If you combine the descriptions of the CSS rules and include a font series, list the font series at the end, for example:
The code is as follows:
H2 {color: red; margin:
10px; font-family: times
Serif}
Sometimes, if the font series is not listed last, IE 3 ignores the entire CSS rule, which is inexplicable but true.
With the font family properties, you can call fonts by font name, and you will have more flexibility when using tags.
This is the end of the content of "how to call the font according to the font name to let the browser display the font you want". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.