Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 131
  • Last Modified:

Deny Text Size Changes

How would I go about making it so that even if the text size is set to to anything other than 100%/medium in their browser, it'll still show as medium? So basically I would always like to show the text size as 100%, nothing else.
0
blizzdek
Asked:
blizzdek
  • 4
  • 3
  • 2
  • +2
1 Solution
 
dorwardCommented:
Short answer: You can't.

Slightly longer answer:

In IE _only_ (unless the user overrides it in their user style sheet) you can define a font size using px or pt as the units in a style sheet for the font-size property. However this is a VERY bad idea:

* http://style.cleverchimp.com/font_size/points/font_wars.GIF
* http://diveintoaccessibility.org/day_26_using_relative_font_sizes.html

The REAL problem is probably not that the user can resize the font, but that the design doesn't work if the user does so. The solution is to fix the design so it doesn't matter. (Using em or ex as the unit for EVERYTHING helps here).
0
 
COBOLdinosaurCommented:
The closest you will come to controlling font size is to do all blocks of text as graphics.  if your design is critically dependent on the font size it will fail in some cases no matter what else you do.  

There is also the accessibility issue.  By trying to control the font size you are basically putting up a sign that says "visually impaired not welcome".

My advice is that you look to developing a more elastic design that does not require this kind of rigid approach that will only look on the computer you develop it on.

Cd&
0
 
hannemanCommented:
<font style="font-size:12pt">I am 12pt text</font>

this will keep text as 12pt even if user changes text size settings in their browser.

not recommended though for reasons Cd has already covered.

-h
0
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.

 
dorwardCommented:
As I said in my initial post - setting the font size in "pt" locks the font size only in Internet Explorer and only without an overriding user style sheet.
0
 
hannemanCommented:
yeah, i thought i would just give a very basic example. as i thought that if blizzdek didnt know how to fix a font size, they also might not know about stylesheets.
0
 
stebesplaceCommented:
Don't waste your time. Let people control what they want. The defacto is medium, so that is what comes shipped as and installed as. if they want to change it, let them, otherwise keep your regular conventions.

-Steve
0
 
kishannarasiahCommented:
its as simple as this.
create one css file
and in that add a class

for ex.
.txt{font-size:10px;}

link the css file to the mail HTML file
so even when the user uses the browser textsize the text size will be the same as you have given in the css file.

goodluck
0
 
dorwardCommented:
Yes yes, we know all about using px to set the font size. Its been discussed already in this thread, and its been pointed out that it doesn't work consistantly accross browsers, and that its overridable even in MSIE.

... but who mentioned "mail"?
0
 
dorwardCommented:
Ohh... a typo for "main"
0
 
COBOLdinosaurCommented:
This question has been classified abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

<note>
Unless it is clear to me that the question has been answered I will recommend delete.  It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.
</note>

If the user does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp


Cd&

0
 
COBOLdinosaurCommented:
It is time to clean this abandoned question up.

I am putting it on a clean up list for CS.

<recommendation>
points to dorward -- grade A

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&

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.

  • 4
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now