How do I change the bg color of an exported iframe?

0 favourites
  • 3 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • I've exported html5 using the advert bar style option and have been trying to change the background color in both html created: "game.html" and "index.html" following some instructions:

    <body style="background-color:#ffffff;">

    The "'index.html" is ok, I could change the bg color, but this is not working on the "game.html".

    I've also tried to change the iframe options but it's not working.

    <iframe style="background-color: white;"/>

    Can someone say why?

    And what to do?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi,

    The game configuration you should control inside C2 such as the game background.

    The index.html background you can change by editing even with something simple as a notepad the index.html file.

    If you open that file just under the <title> you have:

    <style type="text/css">

    body

    {

    background-color: black;

    color: white;

    margin: 0;

    padding: 0;

    overflow: hidden;

    }

    so you can simply write your color there and save before uploading.

  • I did that too. But only worked when I added "execute javascript" into construct through a 'browser' event.

    And then when I changed the exported html that worked. Otherwise the bg color wouldnt change.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)