This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-03-31 08:40:32

HD123
Scratcher
Registered: 2009-12-05
Posts: 500+

Modifying external CSS with Javascript?

I have a webpage where I need to modify external CSS with Javascript.  I am making a background changer for that webpage and Javascript seems to only modify the direct background attribute of the <body> element, since that is deprecated and I want to use a strict DTD what do I do?  Is it possible, and if so does anyone know how to?


~~HD123~~
Treat others as you want to be treated. |  big_smile  | http://i.imgur.com/OaNrY.gif | http://blocks.scratchr.org/libstatus.php?user=HD123&amp;online=http://lemonfanatic.webs.com/ONLINE.png&amp;offline=http://lemonfanatic.webs.com/OFFLINE.png

Offline

 

#2 2012-03-31 09:03:19

scmb1
Scratch Team
Registered: 2009-03-19
Posts: 1000+

Re: Modifying external CSS with Javascript?

Have you ever used DOM? Check this out. The first example in particular may be useful for you.


http://i48.tinypic.com/2z5pqad.png

Offline

 

Board footer