CSS: font |
您所在的位置:网站首页 › css的font-family › CSS: font |
CSS: font-family
By Xah Lee. Date: 2018-11-04. Last updated: 2022-02-23.
font-family property lets you specify a font. Example: body { font-family: Arial, sans-serif; } pre {font-family: Consolas, Menlo, monospace;} Possible Font ValuesValue can be a single value e.g. font-family: Arial; or a sequence of values, like this font-family: Consolas, Menlo, monospace; Browser will use the first one available on user's computer. Generic Font NamesThere are these special generic values: serif a serif font browser uses as default. sans-serif a sans serif font browser uses as default. monospace a fixed-width font browser uses as default. cursive a cursive font browser uses as default. fantasy a fantasy font browser uses as default. system-ui user's operating system font.Here is how it looks in macOS. ![]() ![]() If font name contains space, it should be quoted. (no quote often works but may not if the font name start with a number or is a CSS keyword. ) h1 { font-family:'Times New Roman', serif; } Font Name is Not Case SensitiveFor font examples, see Common Web Fonts Font font-family Common Web Fonts Metrically Compatible Fonts font-size Meaning of Font Size Chinese Font |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |