Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox renders some characters smaller than the font size

Here's a fiddle with some Unicode characters.

<p>★★★½☆</p>

Here it is rendered in Safari, looking as expected:

In Safari, the filled and open star characters are of a size with surrounding text

Here it is in Firefox:

In Firefox, they are considerably smaller than the surrounding text.

I badly need Firefox to look like Safari. What exactly is going on here, and is there anything I can do about it?

like image 600
75th Trombone Avatar asked Jul 14 '13 21:07

75th Trombone


People also ask

Which is used for font size of text in the CSS property sets?

The font-size CSS property sets the size of the font. Changing the font size also updates the sizes of the font size-relative <length> units, such as em , ex , and so forth.

What is the default browser size value for text?

The default text size in browsers is 16px. So, the default size of 1em is 16px.

How do I make font bigger in HTML?

In HTML, you can change the size of text with the <font> tag using the size attribute. The size attribute specifies how large a font will be displayed in either relative or absolute terms. Close the <font> tag with </font> to return to a normal text size.


1 Answers

Those characters aren't present in the font you're setting in your stylesheet, so the browser does fallback to some font that does have the characters. This fallback is done on a character-by-character basis, so different fonts can ed up being used for different characters. Specifically, I strongly doubt Times New Roman has those star characters.

I suggest setting a font that actually has the characters you're using in your stylesheet.

like image 178
Boris Zbarsky Avatar answered Oct 19 '22 17:10

Boris Zbarsky