O'Reilly logo

WebGL Beginner's Guide by Brandon Jones, Diego Cantor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Defining what the GUI will look like

We will define a very simple layout for our application. The title will go on top, and then we have two div tags. The div on the left will contain the instructions and the tools we can use on the scene. The canvas will be placed inside the div on the right, shown as follows:

Defining what the GUI will look like

The code to achieve this layout looks like this (css/cars.css):

#header
{
height: 50px;
background-color: #ccc;
margin-bottom: 10px;
}
#nav
{
float: left;
width: 28%;
height: 80%;
background-color: #ccc;
margin-bottom: 1px;
}
#content
{
float: right;
margin-left: 1%;
width: 70%;
height: 80%;
background-color: #ccc;
margin-bottom: 1px;
}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required