Was just reading an article HERE. so is the below formula.
desired px value / inherited px value = em value
(see the visual example in the article).
is the above a reliable example?
thank you.
Gautam.
Don't know
I didn't look. That's not the right question, though. You should ask if it is necessary.
Set your base font size at the user's default size and use percentages or (preferably) ems from there. Over the years, I have concluded that fixed metrics, pixels, points or picas for example, have no place in defining font size. They are accessibility nightmares. Once you realize that, pixels simply don't matter.
Knowing the pixel size of, say, images does matter because you want to keep the native size where you can, and where you can't, use your image software to scale and crop.
//edit: OK, I found a moment to look at that page. Good advice there. However, it doesn't matter what the user's default pixel size is. Conversion is not needed nor desirable as it gets you thinking about your own display instead of the user's. ~g
cheers,
gary
Thanks gary
Thank you gary , just one more question(sorry to deviate from the real topic), have you moved to flex box layouts or do you still use float based layouts ? i know flexbox lacks support for critical browsers.
Not either/or
I don't use flex simply because I'm not writing new pages. What work I do since retirement is debugging and minor maintenance. There will come a time when I will have to seriously dig into flex, but I'm old and tired.
Don't forget the display property for controlling layout, e.g. table/table-cell or inline block. There are lots of ways to skin a cat with the old methods, too.
cheers,
gary
Thanks for the advice gary
Thank you so much for the advice gary . Happy Debugging .. i don't know how much fun that is though
Thanks alot for you time. Ohh and Chrismas is coming up .. so wish you a very Happy chrismas and new year
Hope you have a good one.