Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Set font size with pixels

Posted on 2008-06-20
3
Medium Priority
?
664 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 1200 total points
ID: 21834075
This is not possible... And setting font size in pixels won't help you in IE 7 either.
0
 
LVL 43

Assisted Solution

by:David S.
David S. earned 800 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn how to count occurrences of each item in an array.

670 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