CSS 应用 Comic Sans Ms 字体样式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21334839/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 01:43:31  来源:igfitidea点击:

Applying Comic Sans Ms font style

cssfont-family

提问by Guffa

How to write a CSS font style for the following text decoration:

如何为以下文本装饰编写 CSS 字体样式:

enter image description here

在此处输入图片说明

font-family: Comic Sans MSCSS rule doesn't work.

font-family: Comic Sans MSCSS 规则不起作用。

回答by Guffa

The font may exist with different names, and not at all on some systems, so you need to use different variations and fallback to get the closest possible look on all systems:

字体可能以不同的名称存在,在某些系统上根本不存在,因此您需要使用不同的变体和回退来在所有系统上获得最接近的外观:

font-family: "Comic Sans MS", "Comic Sans", cursive;

Be careful what you use this font for, though. Many consider it as ugly and overused, so it should not be use for something that should look professional.

但是,请注意您使用此字体的目的。许多人认为它丑陋且过度使用,因此不应将其用于看起来很专业的东西。

回答by evilscary

You need to use quote marks.

您需要使用引号。

font-family: "Comic Sans MS", cursive, sans-serif;

Although you really reallyshouldn't use comic sans. The font has massive stigma attached to it's use; it's not seen as professional at all.

尽管你真的真的不应该使用Comic Sans字体。该字体的使用带有大量污名;它根本不被视为专业。

回答by cnst

The httpd d?mon on OpenBSD uses the following stylesheet for all of its error messages, which presumably covers all the Comic Sansvariations on non-Windows systems:

OpenBSD 上的 httpd d?mon 对其所有错误消息使用以下样式表,大概涵盖了非 Windows 系统上的所有Comic Sans变体:

http://openbsd.su/src/usr.sbin/httpd/server_http.c#server_abort_http

http://openbsd.su/src/usr.sbin/httpd/server_http.c#server_abort_http

810    style = "body { background-color: white; color: black; font-family: "
811        "'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', sans-serif; }\n"
812        "hr { border: 0; border-bottom: 1px dashed; }\n";

E.g., try this:

例如,试试这个:

font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', sans-serif;