Click to See Complete Forum and Search --> : change css font-size in a layer with js.


gokou
09-13-2003, 10:33 AM
I've been trying to change text size in a css layer with javascript because in netscape, text is bigger then in ie, so I'm trying to make the text the same size on both browsers.

I have a css layer defined as class="window2". I was writing javascript code like this:

if(navigator.appName == "Netscape") {
document.window2.fontSize="10px";
}

I've gotten errors with everything I tryed.

Fang
09-13-2003, 01:27 PM
To do this you have to change the style sheet rule selector property value ... which is very poorly supported by any browser.
Anyway if the font-size is 10px, it will be 10px in IE and Netscape, except when a user overrides this with the Text-size option (in Netscape).
You can change style sheets or the class for one or more elements.

gokou
09-14-2003, 03:22 PM
so you use text-size? That only works for netscape?

I'm pretty sure you can do it with javascript also.