Building a web application layout 1

Jul 18, 2008
In a way to build an entire layout for a web application we need to know what exactly we need. In this case I'm going to use a 90% width with a top menu, left menu and a right handed help box used to explain what the current section does. It's always useful to draw a mockup of the layout we want to achieve. Since this is a kind of simple layout we don't really need it, but I still did it. Now we need to start working on the XHTML, which is really simple in this case. As you can see, we need a few DIVs like the header, navigation menu, submenu, help, a footer that is not in the mockup but I decided to add, and a DIV that is going to contain all the layout called wrapper.


	
		WebApp layout
		
	
	
		

This is going to be the main block of the webapp. Here we will have tables, lists, text, etc.

This is going to be the main block of the webapp. Here we will have tables, lists, text, etc.

This is going to be the main block of the webapp. Here we will have tables, lists, text, etc.

Here we will have some help depending on the current task.
We need to get the CSS done. I don't really need to explain a lot at this point but I suggest you to play around with the overflow:auto property and maybe with each column width.
body {
	min-width:780px;
}
#wrapper {
	width: 90%;
	margin: 0 auto;
}
#header {
	overflow: auto;
	background: red;
}
#header,#footer {
	width:100%;
}
#navigation {
	background: green;
}
#menu, #content, #help {
	float:left;
}
#content {
	width:57%;
	margin-left:20%;
	background: yellow;
}
#menu {
	width:20%;
	margin-left:-77%;
	background: gray;
}
#help {
	width:23%;
	background: purple;
}
#footer {
	clear:both;
	background: blue;
}
I know it doesn't look that sexy with all these colors but I usually use them when I'm building the XHTML layout. As you can see in the CSS file, we have a wrapper DIV that is holding the rest of the divs, and it's centered and resized to 90% of the browser window size. So, here is the example file for you to download and play around. In the next step I'm going to include the javascript drop down menu I did in a previous post and I'm bringing a color palette to start working on the design.
Anonymous's picture
James M. Dason on Jul 19, 2008 Very cool... I'm waiting for the next part.
Anonymous's picture
Havvy on Aug 08, 2008 Hmm, you've done the work needed for the layout I want. Do you mind if I take this, remove a part (right hand sidebar), and use it myself?
Anonymous's picture
Ivan on Aug 08, 2008 Sure, go ahead :) I'm currently working on the second part

Post new comment

You can use your Gravatar account.

Mollom CAPTCHA (play audio CAPTCHA)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated.