Click to See Complete Forum and Search --> : using css style sheets with javascript


accumbare
03-09-2003, 04:26 AM
Hi there, i want to use different css files, according to the resolution of the screen. Is this possible by the help of javascript?

Nevermore
03-09-2003, 05:46 AM
You can change the HTML source. I don't know about the CSS source, though.

Da Warriah
03-09-2003, 07:55 AM
well if you give your link tag an id (such as id="css"), and then reference it using this:

document.getElementById('css').src = "style2.css";

that should work...youre just changing the "src" attribute of the tag...ive done it with <script> tags before, this shouldnt be much different...