Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Browser Text Size

Status
Not open for further replies.

DH

Programmer
Dec 8, 2000
168
I have designed a webpage that looks best when the browser text size is set to "smaller". Is there any code available to execute when my webpage opens to set the browers text size to "smaller"?

I am not well versed in Javascript or Java so explaining by example or simple terms would be appreciated.

Thanks.

 
I'm not sure, but I think if you set the size using style sheets, you can set the font-size to whatever you wish, and they won't be able to easily change it. Something like:

<style>
body {font-size:9pt;font-family:verdana;}
</style> jared@aauser.com
 
I believe the user's settings have ultimate control, so if they are nearly blind and they set fonts to super large, there is nothing you can do about it. But, in most cases, people set their browsers to let the webpage decide, so you can use <font> tags in your HTML or use cascading style sheets like Jared suggested.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Hello
this should work fine and gives you creativity flexibility
and goes well in any table.
Set first part in Head.
<STYLE TYPE= &quot;text/css&quot;>

H1.first { position:absolute; top:1%;left:1%;right:1%,
font-weight: bold;font-family: broadway;
Here H1. first is used as a ref then if you have many call them H2. etc….

Then in Body something like that
you may play with the size color etc…

<H1 class=&quot;first&quot;>
<font style=&quot;font-size:8pt&quot;;font color=&quot;cccccc&quot;>hp</font>
<font style=&quot;font-size:10pt&quot;;font color=&quot;999999&quot;>hp</font>
<font style=&quot;font-size:12pt&quot;;font color=&quot;666666&quot;>hp</font>
<font style=&quot;font-size:16pt&quot;;font color=&quot;330066&quot;>hp</font>
<font style=&quot;font-size:26pt&quot;:font color=&quot;33000&quot;>Henry-Paul, your partner</font>
<font style=&quot;font-size:16pt&quot;;font color=&quot;330066&quot;>hp</font>
<font style=&quot;font-size:12pt&quot;;font color=&quot;666666&quot;>hp</font>
<font style=&quot;font-size:10pt&quot;;font color=&quot;999999&quot;>hp</font>
<font style=&quot;font-size:8pt&quot;;font color=&quot;cccccc&quot;>hp</font>
</H1>

 
Dh,
1. If it's for the whole page you can use:

<style>
body {font-size:x-small}
</style>

If it's for part of the page, use classes:

<head>
<title>Untitled</title>
<style>
.sm{font-size:xx-small;}
.sm1{font-size:x-small;}
.sm2{font-size:small;}
</style>
</head>

<body>
<span class=&quot;sm&quot;>smallest</span>
<span class=&quot;sm1&quot;>smaller</span>
<span class=&quot;sm2&quot;>small</span>
</body>

One of these &quot;small&quot; should fit.
Does it work now?
 
I forgot to mention:
The suggestion I made above suppose to be &quot;absolute&quot; and yet the amount of change is determined by the individual computer/browser.(Go figure what's so absolute)

There's also &quot;relative size&quot;:
If you use &quot;smaller&quot; instead of what I suggested.
As I said: I can't say I quite understand the differences between one of the &quot;absolute&quot; size above(say &quot;x-small&quot;) and the &quot;relative&quot; &quot;smaller&quot; but...
Do try and tell...
 
I have tried the suggestion above of:

<style>
body {font-size:x-small}
</style>

However, I am not getting anticipated results. Perhaps I am not understanding or putting the info in the wrong spot.

To recap the problem, Users in IE can goto View> Text Size> and then select the size of Largest, Larger,
Medium, Smaller, or smallest. My site looks best with Smaller selected. So I am would like to automatically tell the IE browser to use &quot;smaller&quot; when loading the site pages. This way it is a no-brainer for the user and the page will look great.

Any additional suggestions????


 
No, you cannot change the users' browser selections! That is their personal choice and you have no right to try to alter it, and the browser manufacturers respect that. What good would your site be for someone with poor vision if you set all of the fonts really small anyway? You can use CSS as suggested, which will set the sizes if the user has decided to accept web designers' selections, but it will not override their own selections if they choose something else.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
I agree with the experienced Tom:
What I suggested will set the fonts onload, but
the user can still control the sizes if he wishes, and although the font size changes using css, the size in the
&quot;View>Text Size>&quot; will remain as the client's default.
i.e. - say, the &quot;medium&quot; will stay there, and yet the size changes according to the css.
I have no more suggestions, but I do need to remind you to check the site in NN and IE, for u r gonna have to determine which size is really &quot;smaller&quot; for each browser.
 
Thanks everyone for your help and suggestions. I have set all the font sizes with CSS. I guess I will make due and hope for the best. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top