Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Changing the Background Color using Global Page

9 years ago

I'm trying to change the background color of my pages using the global background script. After doing some digging in the forums, I found this handy code.

$PAGETEXT := $PAGETEXT + "<body bgcolor='#333399'>"

Only problem is, when I go and copy and paste it into the scripting window and test my story, it doesn't work. The background always defaults to white. Can someone please tell me what I'm doing wrong? 

Thanks!

(Note: I grabbed the code from this forum post, http://chooseyourstory.com/forums/advanced-editor-forum/message/4338)

Changing the Background Color using Global Page

9 years ago

Try $PAGETEXT := $PAGETEXT + "<style>body {background-color: #333399;}</style>"

Changing the Background Color using Global Page

9 years ago

It worked! Thank you! So I just had to wrap it in style tags then?

Changing the Background Color using Global Page

9 years ago

I'd say using style tags is generally better than using multiple body tags for additional attributes.

Changing the Background Color using Global Page

9 years ago
You don't need the single quotes.

Changing the Background Color using Global Page

9 years ago

Thank you for the help. I appreciate it!