Sizing a font on a web page

I have a question about setting the font size of text on a web page. When I set a font at "1.65em," for example, it appears at an appropriate size in Visual Studio's design view, but when I preview the page, the font appears significantly smaller. When I use "165%" essentially I get the same results -- it looks right in design view but too small when previewed. Also, regardless of what em or % I use, the font size changes very little compared to the changes I see in design view. The difference in font size between design and preview mode makes using em or % relatively useless. I don't understand why this is. When I use pixels as the unit of measurement design view is very close to the preview. Is there a breif explanation of this phenomenon?
efzAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
You should "Request Attention" and get the Visual Studio zone added to your question.  While these things are fairly predictable in the actual web browsers, development packages seem to have their own peculiarities.  If we can get some of the experts that use Visual Studio to look at your question, they can probably help you.
0
cb1393Commented:
Is your doctype declaration the very first line in your code?
0
s8webCommented:
Different browsers apply different default formatting. This is very evident with font sizing. A good practice is to set a base font on your body tag, then use % or em elsewhere to define a percent larger or smaller than what the base size is set at. The perk of this is, if you want to globally increase or decrease the size of your text, you do it by increasing or decreasing the font-size set on the body tag.

Personally, I prefer % instead of em. Em was originally for print media. It means the size of the letter m.

So, long story short if you don't define literally on a global scale (like the body tag) what the percent or em is supposed to be a percent or em of, the browser will take % or em to mean % or em of the browser default text size which is not standardized.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

efzAuthor Commented:
Thank you all for your comments.

s8web, how does one globally define the font size? Do you mean including something in the css style file like below?

body {
  margin: 0px;
  padding: 0px;
  border: 0px;
  outline: 0px;
  font-size: 12pt;
}

Then everytime you use the % measure it would be so many percent of 12, i.e., 150% would be the equivalent of a 18pt font.
0
s8webCommented:
Precisely.
0
cb1393Commented:
For more info that may provide additional clarification on the use of EM, see my 2nd comment on the following page:

http://www.experts-exchange.com/Web_Development/Miscellaneous/Q_23213153.html

As for the trouble you are having in Design View in MSVWD, did you verify whether or not the doctype declaration is on the very first line of code?
0
s8webCommented:
Thanks efz, I missed where you said pt. You might want to use px to declare the font size on the body tag. px is the most specific measure. 1px is 1px like 1 liter is 1 liter. pt can be interpreted in a non-specific manner like em or %.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.