navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Free FrontPage Templates

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Converting to em's

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> Converting to em's
Page: [1]
 
davidrandall

 

Posts: 82
Joined: 7/28/2005
Status: offline

 
Converting to em's - 6/9/2006 10:42:02   
Wasn't sure whether to put this here or in accessibility as it covers both.

I always use a relative font size (that can be scaled) on my sites which poses a problem when a client sends their brand guidelines with fonts specified in pixels or points.

This makes using percentages very difficult for font sizes as it's pretty much trial and error to see what looks right. For this reason I now use em's.

Ems are relative to the font size defined in the parent container or, if there isn't one, the browser's default. Therefore 1em is equivalent the the base font size. 2em is twice that size.

As a default, a browser's font size is set at 16px so 1em = 16px. That's not a very managable number so I set the base font size to 10px.
10px/16px = 0.625 so 10px is 62.5% of 16px


I set the font size on the <body> tag to 62.5%. This makes the default font size for the website equivalent to 10px.

1em now equals 10px, 1.6em = 16px and so on.

Dave
jaybee

 

Posts: 14191
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: Converting to em's - 6/9/2006 10:49:38   
Thanks David, I think my brain has coped with that but I was under the impression that 16px in one browser is a different size to 16px in another browser so how do we get round that one?

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to davidrandall)
caz

 

Posts: 3592
Joined: 10/10/2001
From: Somewhere south of Chester, UK
Status: offline

 
RE: Converting to em's - 6/9/2006 14:33:25   
Previously in loads of discussions about this issue some relevant sites are always mentioned, see this post in the sticky above.

http://www.frontpagewebmaster.com/m.asp?m=259135&mpage=1&key=

_____________________________

Do not meddle in the affairs of cats, for they are subtle and will dance, or more on your keyboard.
Cheshire cat. www.doracat.co.uk

I remember when it took less than 4hrs to fly across the Atlantic.

(in reply to jaybee)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> Converting to em's
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts