What font will iOS choose for sans-serif?
Asked Answered
P

1

6

I'm very curious what font iOS actually chooses when setting font-family: sans-serif. I can't seem to find the answer anywhere, so I'm asking here.

body {
    font-family: sans-serif; /* What font will iOS choose? */
}
Panettone answered 20/11, 2013 at 9:49 Comment(3)
It should fall back to Helvetica Neue, as I understand it. Can you post your code? Something doesn't sound quite right here.Diegodiehard
I added the code for you. Your saying it should fall back to Helvetica Neue; Is that what you experienced yourself or is it said by Apple to be the default behavior?Panettone
It was drawn from experience - as it turns out I was slightly incorrect, it's actually Helvetica (not Neue) :)Diegodiehard
F
13

The default sans-serif font on iOS 6 and iOS 7 is Helvetica. I've set up a test with this CSS:

div.default {
    font-family: sans-serif;
}

div.helvetica {
    font-family: 'Helvetica', serif;
}

The result is the very same. I also inspected it using the developer tools, to make sure the styles are applied correctly.

iOS 6

enter image description here

iOS 7

enter image description here

Fiacre answered 20/11, 2013 at 10:10 Comment(1)
Thank you for your answer and putting so much effort in it by setting up a test!Panettone

© 2022 - 2024 — McMap. All rights reserved.