Solved

Set font size with pixels

Posted on 2008-06-20
3
649 Views
Last Modified: 2008-07-08
Hello experts,

The question of the day is:  Is there a way to prevent Firefox from resizing my "px" precise fonts?  By that I mean, in IE you can increase/decrease font sizes using the "em" measurement.  However, when you use "px", you cannot resize them.  For portions of my design i must use pixel precise fonts.  Problem solved with IE, I just use "px" for my font sizes that cannot change.  HOWEVER, firefox still resizes them.  So how can I enfoce the font size without using images?  Possible?

In the code below, only Paragraph 1 is resized when I change the "browser" font size.  In firefox, all 3 change.  How to get Firefox to behave like IE?
<html>
<head>
<style type="text/css">
.p1{font-size:1em;}
.p2{font-size:12px;}
.p3{font-size:14px;}
</style>
</head>
<body>
 
<p class="p1">Paragraph 1</p>
<p class="p2">Paragraph 2</p>
<p class="p3">Paragraph 3</p>
 
</body>
</html>

Open in new window

0
Comment
Question by:js_vaughan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
NeoTeq earned 300 total points
ID: 21834075
This is not possible... And setting font size in pixels won't help you in IE 7 either.
0
 
LVL 42

Assisted Solution

by:David S.
David S. earned 200 total points
ID: 21835668
You can not. Being able to change the font-size is a basic usability feature of web browsers.

I recommend you learn how to make your designs more flexible. If you showed it to me, I just might be able to give you some suggestions.
0
 
LVL 4

Expert Comment

by:sajay_j
ID: 21842926
Usage of percent values for fonts.

<html>
<head>
<style type="text/css">
.p1{font-size:40%;}
.p2{font-size:120%;}
.p3{font-size:140%;}
</style>
</head>
<body>
 
<p class="p1">Paragraph 1</p>
<p class="p2">Paragraph 2</p>
<p class="p3">Paragraph 3</p>
 
</body>
</html>
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CSS Won't Show Up On Drupal Omega Sub-Theme 1 36
Loading Self-Hosted Fonts 12 43
Best explanation of following code css 11 40
Page link not showing on Mobile Device 3 54
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question