Hi,
I know the default number of pixels for '1 em' is 16.
Now suppose a user increases the font size using the browser menu
View | Font size
I would like to know how many pixels the an 'em' is now....it could be 24, 36, etc depending on how big the user made the font. How can i get that in php code?
Any ideas. Maybe Image functions can do it?
Thanks
Savoye
How to get num pixels for 1 EM when user increases font size
Moderator: General Moderators
-
SavoyeSmith
- Forum Newbie
- Posts: 1
- Joined: Sun Jan 20, 2008 9:30 pm
Re: How to get num pixels for 1 EM when user increases font size
Two things:
1. em is a relative unit and is dependent on the inherited font-size for the element or the declared font-size for the document. 1em equals 100%, 1.2em equals 120% etc. It is not necessarily 16px
2. You have no control on the client side (ie browser) using PHP. To calculate font-size you would have to use Javascript
1. em is a relative unit and is dependent on the inherited font-size for the element or the declared font-size for the document. 1em equals 100%, 1.2em equals 120% etc. It is not necessarily 16px
2. You have no control on the client side (ie browser) using PHP. To calculate font-size you would have to use Javascript