Hi, In the past I put some HTML code into my webiste that set my font to be a standard size. Even if a customer changed their text size setting in the view option on the menu bar the font size would stay the same. I just can't remember the code I used for this.
lol so if somebody wants to increase the font size of your page because they can't read it you want to prevent them from doing this? okay then.. :s
Well said, not a great idea imho, I would personally find it annoying. If I couldn't read it and couldn't change it then I would just leave, no good sticking around on a site where I can't read the contents Dee
Damnnn: maybe what you want to do is, if the user increases the font size, everything just gets bigger (like what happens with Zoom in browsers that can zoom) without the text pushing boxes out of the way and stuff. Not all browsers zoom (safari), and many browsers let you enlarge the font size without zooming (IE, FF). I usually prefer to enlarge text because I don't like images looking crappier with zoom on. usually you can do this by setting all your sizes of all your boxes in em, and then also your fonts. It can be tricky, but then as the text enlarges, everything else also enlarges at the same rate. Only problems are, images don't grow too (unless you're using the growing image trick), and if you don't set a width on your page then eventually a horizontal scrollbar will appear. Someone might also set their OS fonts to something ginormous, not in the browser. So your fonts would still get enlarged no matter what CSS you have.
A quick and handy way to zoom and/or change text size via keyboard shortcuts when viewing web pages: When using MSIE ..... * Zoom out: ctrl + (larger - repeat until desired size is obtained) * Zoom in: ctrl - (smaller - repeat until desired size is obtained) * Return to original size: ctrl 0 (zero) When using Firefox ..... same as with MSIE (You can specify "change text size only" in Firefox via the top menu bar: View ---> Zoom ---> Zoom Text only. Setting remains until changed. The above keyboard shortcuts will now only change the text size leaving the image sizes as original). When using Safari/Chrome ..... same as with MSIE except the keyboard shortcuts only change the text size leaving the image sizes as original. When using Opera ..... same as for Firefox/MSIE except use shift + for Zoom out. Visitors who use a scrolling mouse can zoom/increase text size very fast via ctrl scroll -- for all Browsers listed above -- keyboard shortcut ctrl 0 (zero) returns to original size. Web developers/authors might want to check pages they are composing to be sure navigation is not affected by incremental zooming (visitors will seldom zoom more than three increments). In my experience, many visitors (especially those with diminished vision) to web pages now increase the text size by one or two increments for easier reading especially when very small text is encountered. James
The <font> tag specifies the font face, font size, and font color of text.. <font size="3" color="red">This is some text!</font> <font size="2" color="blue">This is some text!</font> <font face="verdana" color="green">This is some text!</font>
The <font> tag is deprecated and its use is not encouraged. CSS is preferred. The <font> tag may be your only way to style text IF you are writing HTML for an email client who doesn't even allow you to use inline styles (but I don't know of any who don't).
This thread has got me thinking; although I've always tried to steer away from setting a specific font size I do think that I've done it on a couple of my websites. I'm starting to get more familiar with CSS at the moment but I've not done a lot with regard to font within it so I'd appreciate some clarity if anyone could offer it - is there still a way to set a sort of default size within the CSS? If so, with the <font> tag being deprecated, what is the code to use in that instance?
State the element you want to style. Set a font size in something other than pixels (because IE6 and below won't let users change a font size set in px). I use em's because they're usually pretty easy. In the body, to help IE with enlargement issues, I do this: body { font-size: 100%; (for some reason, it helps a bug... other people do 101%) } Later, if I set anyone to 1em, that'll be the user's default. If the user's computer was set to like 30px sized fonts for easier reading, then my 1em will be their 30px. Anything larger than 1em will be larger than their 30px, and anything smaller (.9em etc) will be smaller. You can't assume everyone is set to 16px like you hear on teh innerwebz. That's a popular default, but will miss those who need larger text! Don't rely on it. 1em doesn't rely on anything. It's whatever the user chose. So your text: #main p { font-size: 1em; } want headers larger? h1 { font-size: 1.8em; } h2 { font-size: 1.6em; } etc. But that's just one way to do it. Search the web, but be wary of the "62.5%" thing. It's supposed to be a handy way to tell how many pixels an em is, but since not everyone has the assumed default font size, it's comparing apples to cows. How many apples = 1 cow?