Skip to main content
Participating Frequently
Sep 5, 2017 7:27 PM UTC
Question

Browser fill with HTML5 canvas

Can someone explain how to set the browser fill when exporting as an HTML5 document? There used to be an option for this in the publish settings when it was still Flash.

Thanks.

    This topic is closed to new replies. Start a new post to keep the conversation going.

    8 replies

    Participant
    Dec 16, 2021 12:54 AM UTC

    I have this question also. how do you change the color outside of the stage? I don't know what that area is called. The area beyond your document size...

    Translate
    JoãoCésar17023019
    Community Expert
    Community Expert
    Dec 16, 2021 10:12 AM UTC

    Hi.

     

    It's the document's body.

     

    There are several ways of changing its color. Some are described below.

     

    1 - Use JavaScript in the main timeline to match the stage/canvas color like this:

     

    document.body.style.backgroundColor = lib.properties.color;

     

     

    2 - Use JavaScript in the main timeline to assign a custom color:

     

    document.body.style.backgroundColor = "green"; // any valid CSS color value

     

     

    Both ways work but they will only change the background color when your content is fully loaded.

     

    3 - If you wish to change the background color immediately, you can edit the publish template and change the color in there using CSS.

     

    I hope this helps.

     

    Regards,

    JC

     

     

    Translate
    Participant
    Dec 16, 2021 4:50 PM UTC

    Thank you! This definitly helps. You're a ninja.
    Jeff

    Translate
    Legend
    Sep 5, 2017 8:52 PM UTC

    "Browser fill"?

    Translate
    Participating Frequently
    Sep 6, 2017 1:28 PM UTC

    The background color of the browser. I would like it to match the canvas background so that it will look consistent no matter the size of the window. It seems to default to white.

    Translate
    Inspiring
    Sep 6, 2017 2:14 PM UTC

    If you don't have anything selected and have are using the default selection tool, and open the properties, you should see the option to change the stage color.

    Translate