Web Tutorial Plus

Single Page Website with CSS Layout


For designing and developing an effective, good looking website, it is important that you have a good knowledge of HTML and CSS. While HTML helps you to put your actual contents on web pages, CSS takes care of the presentation part. CSS is used to separate the presentation part from your contents which in turn makes your web pages light-weight and more readable. It significantly reduces your page load time and helps your website attain better positions in search results.

Here, we will learn to plan, design and create a single page website with simplistic look. The purpose of this tutorial is to take you through the process of website design, deliberating layout essentials and encourage you to start building websites yourself. We will create one page website here, but after you are familiar with the process, it should not be difficult for you to create more complex websites.

Introduction

This tutorial is intended for those who have some basic knowledge of HTML, but it does not require any previous knowledge of CSS. We will start here from scratch and build a fully functional website. This step by step tutorial will also help you to understand the basic concepts of CSS. After you complete this tutorial, you should be able to start building decent and effective websites on your own. In the process, we will create an HTML file and a CSS file and learn how to link them together. For demonstration purpose, we will use one of the websites created by me - Sangla Holiday Home. Just have a look what we will build at the end of this lesson:
Sangla Holiday Home
This is an example of a simple One Page Website.
I created this website in 2 hours flat on request of a friend. I don't claim that it is beautiful, but it will certainly help you to understand the concepts of CSS Layout and website design. Wherever necessary, I will explain about the css rules and attributes and also recommend the best practices.

Basic Website Design

As you may notice, there are four major sections of this website - Heading Section, Links Section, Content Section and Footer section. All the sections used in this website are rectangular and we will use <div> tags for them. The div is nothing but an empty rectangular container which is used along with CSS for placing the contents in websites.

As for any website layout design, the width can be defined either in pixel (fixed width) or in percentage (varies with display width). Both have some advantages and disadvantages - you may go through our article on Website Design Considerations for more information on this. Here we will use the fixed width layout.

Directory and Files

First thing you need to do is to create two folders in the root directory (named as 'htdocs' or 'wwwroot') of your website - 'images' and 'css'. Now create a new 'html' file in root directory and name it as 'default.html'. Also create a new 'css' file. You can do this by saving a text file with '.css' extension, just like html file. If you are using windows, open Notepad and type /* CSS File */ and save it as default.css in your 'css directory'.

In css, the text between '/*' and '*/' is treated as comment. It is a good idea to keep writing comments. This makes the code easy to understand and takes lesser time to make any change later on. We will keep the image files in 'images' folder. As of now download and save the image used in background of 'heading' section.

This is all we need to start!


Leave a comment Leave a Comment....

Name*:
Email*:
[Your email will not be published.]
Website: [Include http://]
Answer This: 18 + 10 = [Anti-Bot]
Valerie Valerie 12 Jul 2012
I found this tutorial very helpful. Thank you for sharing your knowledge.
Gunjesh Kumar Gunjesh Kumar 13 Jul 2012
Thanks for your valuable feedback Valerie.
rahul rahul 27 Jul 2012
very nice.....
Penny Penny 30 Nov 2012
You stated 'We can apply some really cool effects to this website by using css3. This I will explain in a separate section." Have you done that yet? I so need to learn that this week and I can't find help any place.
Gunjesh Kumar Gunjesh Kumar 15 Dec 2012
Hi Penny, we have a number of CSS3 generators available now which you can use to get the CSS3 codes. These allow you to visualize the styles and once you are done, you can copy and paste the generated code straightaway in CSS file. Good Luck!
Kai Kai 7 Jan 2013
The "Clear: both" is really help me a lot. thank you :)
James James 21 Mar 2013
Thanks
© 2013 Web Tutorial Plus