Applying Comic Sans Ms font style
Asked Answered
D

4

53

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

Comic Sans MS

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

Distributor answered 24/1, 2014 at 14:14 Comment(1)
possible duplicate of Difference between "font-family" and font-family?Superinduce
V
102

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.

Viddah answered 24/1, 2014 at 14:23 Comment(2)
I'm using this to show that a font file is missing and it need buying before we launch the siteBunting
Are you kidding bro? I would buy anything in a website that uses Comic Sans as main font!Bryonbryony
I
13

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

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;
Impatience answered 19/2, 2016 at 17:47 Comment(0)
R
8

You need to use quote marks.

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

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

Rundle answered 24/1, 2014 at 14:18 Comment(3)
There are uses for it. I have been developing an app for wife to use in her kindergarten class and it is perfect for that.Gurgitation
"it's not seen as professional at all" might be not that wrong in most cases – the point, John is trying to make, is simply that there are cases where the "effect" of using this font is intended: Comic books, children, fake handwriting, etc.Blairblaire
as a professional, I love comic sans.Foetus
L
3

Use quotes to surround the font:

font-family: "Comic Sans MS";

That should solve the problem.

Lasko answered 21/5, 2021 at 15:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.