Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Set font size with pixels

Posted on 2008-06-20
3
Medium Priority
?
669 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
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
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.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

876 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