Hi guys,
I have trouble defining font sizes in CSS so that they remain consistent, some people use PX, EMs and %, which is best ?
Ideally, lists, paragraphs, block quotes would be the same size, but using percentages, some always end up smaller than others. Can some of you share your methods of text size consistency throughout a layout, do you all define each classes font size? So .example p {} .example2 p{} etc etc ?
Do you define font size in the reset and body ? or neither ? I want to just be able to enter h3 title h3 without it being smaller than the same tag in another div and whatnot. It does my head in lol, please share.
- Sold between 250 000 and 1 000 000 dollars
- Won a Competition
- Author was Featured
- Item was Featured
- Exclusive Author
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Europe
- Bought between 10 and 49 items
I’m setting base font size in the body tag. for example font-size:0.75em; which stands for 12px.
Then define h1,h2,h3 with sizes you want… and again i em. Recently I’ve discovered http://pxtoem.com/ website. This one is really a time saver (Y)
I recently wrote a blog post about this:
http://www.brenelz.com/blog/2008/12/29/dealing-with-css-font-sizes/
-Brenelz
- Bought between 10 and 49 items
- Denmark
- Exclusive Author
- Has been a member for 4-5 years
- Sold between 100 and 1 000 dollars
I usually just set the base size to 62.5% (10px) and then define the font sizes in ems later. For example 1.2em, which equals 12px. You just move the comma – no need to do calculations every time.
Bah, I have no URL I can Spam with boo hoo.
Here’s some useful typography tools: http://pxtoem.com/ http://www.typechart.com/
