Centering the canvas within an html page

26 views
Skip to first unread message

Erik the Anarchitect

unread,
Jul 26, 2016, 7:47:54 PM7/26/16
to Glowscript Users
I have successfully exported a program to a web page and I want to refine the presentation.

Is there a way to center the canvas within the window in html?  I am afraid I will break something if I modify the html tags in the autogenerated text I am supposed to embed in the web page.

Aaron Titus

unread,
Jul 26, 2016, 7:54:54 PM7/26/16
to glowscri...@googlegroups.com
The HTML that is exported by GlowScript is merely a <div>...</div> tag with the GlowScript for the simulation between the div tags. 

You can put this into a html page within center tags. However, there is also another way. See the example at:


In this case, I put the GlowScript in a separate html page. I then embedded this html page using <iframe> tags such as:


<center>
<iframe src="./Chapter_3-4/celestial_sphere/ecliptic-gs.html" width=500 height=500 align="center"></iframe>
</center>

The source of the simulation is posted at:


As you can see, I centered the iframe.

Aaron

On Jul 26, 2016, at 4:34 PM, Erik the Anarchitect <enelson...@gmail.com> wrote:

I have successfully exported a program to a web page and I want to refine the presentation.

Is there a way to center the canvas within the window in html?  I am afraid I will break something if I modify the html tags in the autogenerated text I am supposed to embed in the web page.

--

---
You received this message because you are subscribed to the Google Groups "Glowscript Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glowscript-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages