• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Change color outside the stage on Canvas HTML document?

New Here ,
Jan 21, 2022 Jan 21, 2022

Copy link to clipboard

Copied

I'm wondering if it's possible to change the standard white background outside the stage when publishing as a Canvas HTML5 doc?

 

Screenshot 2022-01-21 151818.png

TOPICS
Code , How to , Import and export , Other , Publish package

Views

123

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 21, 2022 Jan 21, 2022

Hi.

 

That's the body's background color. You can change its color using JavaScript or CSS.

 

Here are two ways of changing it using JS (you can place the code in the first frame of the main timeline):

document.body.style.backgroundColor = "red"; // any valid css color

// OR

document.body.style.backgroundColor = lib.properties.color; // if you want the body to have the same background color as the stage

 

If you want/need to change the color before your content loads, then you're gonna need to

...

Votes

Translate

Translate
Community Expert ,
Jan 21, 2022 Jan 21, 2022

Copy link to clipboard

Copied

LATEST

Hi.

 

That's the body's background color. You can change its color using JavaScript or CSS.

 

Here are two ways of changing it using JS (you can place the code in the first frame of the main timeline):

document.body.style.backgroundColor = "red"; // any valid css color

// OR

document.body.style.backgroundColor = lib.properties.color; // if you want the body to have the same background color as the stage

 

If you want/need to change the color before your content loads, then you're gonna need to use CSS and for this you have to either modify the published HTML file or use a publish template.

 

I hope this helps.

 

Regards,

JC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines