Welcome to WebmasterWorld Guest from 54.166.5.230

Forum Moderators: not2easy

Message Too Old, No Replies

How do I keep text the same size on a web page?

Can I prevent viewers from changing the font size?

     
9:58 am on Feb 20, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 29, 2006
posts:55
votes: 0


Hello,

can anyone tell me how I can stop viewers of my sites from changing the font size. I realise this is not a great thing to do because of people who have sight difficulties but occasionaly it would come in quite useful.

Please help.

Regards

Erdy.

10:06 am on Feb 20, 2007 (gmt 0)

Preferred Member from ES 

10+ Year Member

joined:Nov 13, 2005
posts:646
votes: 0


You must define a STYLE. I.e.:

<STYLE="font-family:arial; font-weight:bold; font-size:12pt;">

Or, better, you should read somthing more about CSS basics.

[edited by: Lexur at 10:07 am (utc) on Feb. 20, 2007]

10:38 am on Feb 20, 2007 (gmt 0)

Full Member

10+ Year Member

joined:July 8, 2005
posts:348
votes: 0


That doesnt work in every browser though.
3:23 pm on Feb 20, 2007 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 17, 2005
posts:4993
votes: 14


1. What you're trying to do is very bad for accessibility. All you will accomplish is annoying those people who want to change the font size. Don't take away the people's right to choose.

2. If you're designing a site that is dependant on a particular font size, then you have a very poorly designed site.

3. What you're asking for can only be achieved in the IE browser (I'm not sure if this "bug" was fixed in IE7 or not). You will not be able to prevent all browsers from being able to change the font size, because most of them are smart enough to keep control at the viewer's end instead of the designers.

Instead of trying to figure out how to do this, you should spend your time learning about why you should NOT do this.

8:31 pm on Feb 21, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 21, 2005
posts: 1526
votes: 0


Actually, I've found there is no way to prevent modern browsers from changing text sizes. The only thing that you can do is override the user's default settings.
8:54 pm on Feb 21, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member suzyuk is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Oct 1, 2002
posts:5199
votes: 0


cmarshall is correct, there is no way this to do unless you use a graphic

Even IE have fixed their pixel resizing bug. Opera lets you overide any websites default by letting you set a minimum font size and all browsers have a zoom or text-resize feature

[edit] just to clarify the "bug" - IE6 and below won't let you resize if the text size is specified in px and was the last browser you could almost have relied on to do what you're asking

[edited by: SuzyUK at 9:00 pm (utc) on Feb. 21, 2007]

10:10 pm on Feb 21, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2006
posts: 3123
votes: 0



Fotiman:
(I'm not sure if this "bug" was fixed in IE7 or not)

SuzyUK:
Even IE have fixed their pixel resizing bug. ...

[edit] just to clarify the "bug" - IE6 and below won't let you resize if the text size is specified in px and was the last browser you could almost have relied on to do what you're asking

Hhhmmmm... admittedly I have used IE7 very little - just to test - but I didn't think IE7 had solved this "bug" of refusing to resize text that had been defined in 'px' (via the menu... View > Text Size) ...?! The 'zoom' feature yes, but not the Text Size menu option. I specifically tried this recently with an old site where the font-size was defined in px throughout - the View > Text Size menu option did nothing in IE7. Are there later versions of IE7 that do sort the problem, or am I missing something?

Also mentioned in this thread:
[webmasterworld.com...]

Opera lets you overide any websites default by letting you set a minimum font size

Firefox too.

1:50 am on Feb 22, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:Feb 28, 2005
posts: 646
votes: 0


Hhhmmmm... admittedly I have used IE7 very little - just to test - but I didn't think IE7 had solved this "bug" of refusing to resize text that had been defined in 'px' (via the menu... View > Text Size) ...?! The 'zoom' feature yes, but not the Text Size menu option. I specifically tried this recently with an old site where the font-size was defined in px throughout - the View > Text Size menu option did nothing in IE7. Are there later versions of IE7 that do sort the problem, or am I missing something?

I was pretty sure this wasn't fixed also - but, at least, holding Ctrl and scrolling with the mouse wheel no longer changes Text size, rather, page zoom.

While IE 7's page zoom isn't as good as Opera's, it's better than nothing :)

8:09 am on Feb 22, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member suzyuk is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Oct 1, 2002
posts:5199
votes: 0


I was pretty sure this wasn't fixed also - but, at least, holding Ctrl and scrolling with the mouse wheel no longer changes Text size, rather, page zoom.

Ah yes thanks for you correction, I was indeed just thinking about the zoom feature, as you say it's better than nothing!

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members