Solved

Set font size with pixels

Posted on 2008-06-20
3
622 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 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now