Fixed fonts

greg's picture

He has: 1,581 posts

Joined: Nov 2005

How can I make text fixed in size?

So browser text resizers and holding the CTRL key and mouse scroll doesnt change the size of the text?

cheers

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

So you want to completely rip out the accessibility features of web browsers?

In a nutshell, you can't. And there is no need to. If someone has their default font size set something other than normal, they will be used to pages not necessarily showing right.

-Greg

Roo's picture

She has: 840 posts

Joined: Apr 1999

You can set the font using whatever px in the css

p {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
line-height: 16px;
color: black;
}

But yes, the end user setting will still prevail.

Roo

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Pixel font sizes are resizeable in all browsers now. (Zooming in IE 7). They won't be resizeable in IE 6.

Otherwise if it's that important to you and it's a small bit of text you could put it in a graphic, or in flash.

greg's picture

He has: 1,581 posts

Joined: Nov 2005

Greg (k) - I want to remove the accessibility of nothing. In fact, I would be providing and maintaining accessibility by keeping certain text to a fixed size by the fact I am allowing certain things on my page stay how they should.
I have a small menu, and the menu is fixed size images, so when the text is resized even once it's not usable.

I understand that users will be used to pages messing up and becoming unusable when they change the page fonts. I have seen so many different problems myself with so many sites with the font resize not being catered for.

But if there is no way to change it with CSS/HTML then I suppose my only option is to add the text to the images, which I hate doing.
It's just wrong somehow.

Anyway, thanks for the replies peeps

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

greg;224150 wrote: Greg (k) - I want to remove the accessibility of nothing. In fact, I would be providing and maintaining accessibility by keeping certain text to a fixed size by the fact I am allowing certain things on my page stay how they should.
I have a small menu, and the menu is fixed size images, so when the text is resized even once it's not usable.

The unwanted constraint there is relying on a fixed-size graphic. Depending on exactly what the graphic is, you might get around it with some clever CSS, and still use relative dimensions for sizes.

greg;224150 wrote: I understand that users will be used to pages messing up and becoming unusable when they change the page fonts. I have seen so many different problems myself with so many sites with the font resize not being catered for.

You can cater for the resize by using relative dimensions, as everything will scale up or down. This allows you generous margins within which the design will not lose integrity while retaining accessibility. The margin is far narrower when sizes are fixed.

As browsers increasingly allow full page zooming, as Megan mentioned, in addition to text resizing, you'll have to worry less about layouts falling apart under scaling.

Find another way to present your graphical material. Smiling

He has: 629 posts

Joined: May 2007

It would be nice to have text appear at a specified size on screen, the way we can for print. However, think about it. Text size on a 19" monitor is much bigger if you set it to 800 x 600 or 1024 x 768 than when set to 1600 x 1200. It will be smaller still if the DPI is set to 120 instead of 96.

Fonts themselves also differ in size. Hopefully you specify a range of fonts, since not all computers have the same fonts installed. Verdana is bigger than Arial, for example. Georgia is bigger than Times.

Bottom line - there's no telling what size your font will appear on any of your visitor's screens. As Greg rightly notes, every browser on earth allows for font resizing. Even IE6. Just make sure your pages don't break if someone needs to change the size - it's quite easy to do.

Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.