Jump to content
xisto Community
Sign in to follow this  
Joshthegreat

Simple Layouts

Recommended Posts

New to HTML? try this simple website layout to get you started.Well, start your site by creating a table to display your content.

<html><head><title>My Webpage</title><STYLE type=text/css><!--@import url( yourname.css );--></STYLE></head><body><table width="700" border="1" cellpadding="3" cellspacing="0" align="center" class="MAIN_TABLE"> <tr>  <td valign="top" height="100" colspan="2" class="CELL">   Your banner  </td> </tr> <tr>  <td width="15%" valign="top" height="25" class="CELL"> Menu  </td>  <td width="85%" valign="top" height="25" class="CELL"> Main Content  </td> </tr> <tr>  <td width="15%" valign="top" height="400" class="CELL"> <li><a href="link">Link</a> <li><a href="link">Link</a> <li><a href="link">Link</a> <li><a href="link">Link</a> <li><a href="link">Link</a> <li><a href="link">Link</a>  </td>  <td width="85%" valign="top" height="400" class="CELL"> Your Main Content  </td> </tr></table></body></html>

Save this file as 'Yourfile.html'You have to say that if you have seen this file in action, it's really very dull.So... Lets liven it all up with some css.CSS can look quite complicated at first. Well, don't let that scare you away. It's actually quite simple.

BODY { BACKGROUND-COLOR: #0066CC; FONT-COLOR: #000000; FONT-FAMILY: verdana; TEXT-DECORATION: underline;}

Save this file as Yourname.css.You will notice that all this will do is make the bacground blue, and change the font to Verdana. This really doesn't do too much for your site. So lets spruce up the links shall we?

A { FONT-COLOR: #0066CC; }A:hover { FONT-COLOR: #000000; TEXT-DECORATION: none;}

This will make the links blue with an unerline. It will also mean that when you hover your mouse over the links the unerline will dissapear, they will turn black and the text will become bold.Well your site will still be looking quite dull. So lets spruce up your table adding the class tag in your html. You'll notice in the table code at the top of the page you'll see class="MAIN_TABLE". This defines the table to you can customise it's appearence in the CSS.

.MAIN_TABLE { BACKGROUND-COLOR: 000000; BORDER: 1px solid #000000;  }

This will make the main table background black.You'll also notice that in the html there is a class="CELL" bit of code on all of the cells. So lets spruce them up.

.CELL { BACKGROUND-COLOR; #FFFFFF;

This will make the cells white.Well you can add whatever content you like and you may want to add some background images and regular images to make it look better. Also change the colors to suit what you want it to look like.Well, hope my basic tutorial has helped some of you. If I happen to have a made a mistake somewhere, please tell me. And I'll correct it.

Share this post


Link to post
Share on other sites

Thanks for your comments guys. That makes me feel happy that I can actualy contribute with a good tutorial. I'll probably write some more ones now, hopefully they'll be as decent as this one.

Share this post


Link to post
Share on other sites

I agree with what everyone said - nice simple tutorial! The only thing I don't agree with is using tables for positioning because the browser has to render every aspect of the table first before displaying your site.Other than that, way to go! :)

Share this post


Link to post
Share on other sites

Just thought I'd say that rather than importing an external .css file through a "style" tag in the head, you could just put this in the head of the HTML document:

<link rel="stylesheet" type="text/css" href="yourstyle.css" />
And just an FYI: all attributes and css properties should be in lower case (except for specific classes that you define in your css -- those can be uppercase).

Very good tutorial for beginners, teaches a lot of useful information.

Share this post


Link to post
Share on other sites

Yeah, I just prefer using the import CSS tag rather than the link tag. I guess that's just me. I find the CSS one eaier to remember, I always find myself forgetting the link tag for some reason.

Share this post


Link to post
Share on other sites

I don't know about this much but I tried it on Microsoft Frontpage and it looks really nice... however i have a question (might be silly):Take the page you have created in your tutorial, and I want that to appear in my every page, with everything the same in every page except the main content. And one day you decide to add one more link to that column under 'menu', do i have to add it manually to every page or how can i just do it once and the rest of the pages auto-update by itself?thanks

Share this post


Link to post
Share on other sites

save the page as .phpNow where the menu is, copy and paste the menu part of the code into a new file and name it menu.html. Now where ther menu used to be type in <? include('menu.html') ?>.This should mean you only have to change one file for every page.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.