PDA

View Full Version : Precise font sizing


Gnarly
04-19-2012, 07:27 PM
Wondering if someone can give me some insight.

I'm trying to get my font to be about 0.90em. The problem is Safari seems to be telling me that I can use either 1em or 0.75em (guesstimate). Nothing in-between will work. The same issue happens when I use px.

Am I doing it wrong??

Gnarly
04-23-2012, 09:27 PM
Ok then, does anyone know where the nearest army recruitment center is?

d a v e
04-24-2012, 04:20 AM
link to your site would be useful ;)

edbr
04-24-2012, 05:35 AM
not sure how relevant it is but did you use a css reset, it might help level the playing field. if not the Infantry are always on the look out i heard.
welcome to the forum BTW

edbr
04-24-2012, 05:37 AM
ah just found this afeter a quick yahoogle
I did another test by increasing Safari's font size to 18px, and the
>> layout expanded. This makes the EM not stable to use for layout. I wonder
>> if it has always like this for Safari or is a new bug.

try % perhaps

Gnarly
04-24-2012, 06:27 PM
not sure how relevant it is but did you use a css reset, it might help level the playing field. if not the Infantry are always on the look out i heard.
welcome to the forum BTW

Lol, thanks.

From what I gather, 1em is equal to the default browser font size. Just another way of saying 100%? I was just hoping to go a bit deeper into the fractions than I apparently can.

d a v e
04-24-2012, 07:10 PM
i usually set 62.5% on the body then everything else in ems
e.g. 24px heading is 2.4 em

again, as always, a link would be easier to see how you have things set up

gentleone
04-24-2012, 10:29 PM
Don't forget that em's take the size of the parent. The size can get really unexpected small if you use different font-sizes in nested elements.

edbr
04-25-2012, 01:00 AM
From what I gather, 1em is equal to the default browser font size. Just another way of saying 100%? I was just hoping to go a bit deeper into the fractions than I apparently can.
the article i saw was quoting a bug that safari has handling em's, the recommendation was to use %'c and offered a reset for it, i didnt save it im afraid but found it quickly searching safari and em issue

domedia
04-25-2012, 12:56 PM
i usually set 62.5% on the body then everything else in ems
e.g. 24px heading is 2.4 em

again, as always, a link would be easier to see how you have things set up

I do exactly the same, but use 'rem' instead. It does not inherit the size of the parent elements.

html {
font-size: 62.5%;
}
body {
font-size: 14px;
font-size: 1.4rem;
}

For more information about this technique from Jonathan Snook:
http://snook.ca/archives/html_and_css/font-size-with-rem

.

Gnarly
04-29-2012, 12:04 AM
Dave, don't have a link as I'm just testing at the moment. Had no idea that people set the font size of the html, and I've never even heard of rem!

d a v e
04-29-2012, 05:02 AM
i've never heard of rem either - in all the things i've read about font sizing i don't remember seeing it mentioned once :)

gentleone
04-29-2012, 07:44 AM
Browser support is surprisingly solid for 'rem'. We only have to use 'px' as fallback for IE8- and Opera Mini, so it's save to use today. This is awesome, because em's can become really confusing with nested elements.

http://caniuse.com/#search=rem