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:
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; }
And we can use it like this (taken from ch9_GUI.html
):
<body> <div id="header"> <h1>Show Room</h1> </div> <div id="nav"> <b>Instructions</b> </div> <div id="content"> <h2>canvas goes here</h2> </div> </body>
Please make sure that you include cars.css
in...