Go Back   Novahq.net Forum > Computers > Web design and Programming
FAQ Community Calendar Today's Posts Search

Web design and Programming Discuss website creation and other programming topics.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-20-2008, 12:30 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
CSS Lesson 1 -Fixed Layout Basics

For those who are interested in building a CSS enabled website I will give you a basic understanding of some good things to do when starting out.

1. Decide if you want the layout of the site to be fixed or relative to the screen size. Fixed will always stay the same size and relative will be positioned in the center of the page.

2. If it is fixed then what you need to do is choose your width. I like around 780 because it looks okay on a 800x600 monitor. Then what you do is create a <div> with that width and name it maincontainer or something similar.

Html:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>My Site</title>
<link rel="STYLESHEET" href="defaultTheme.css" type="text/css">
</head>
<body>
<div id="maincontainer">
</div>
</body>
</html>
For the fixed version you will need to set the width to 780px and use margins:auto; to center it.

CSS:
Code:
body
{
  background-color: #00000;
}
#maincontainer
{
  margin-left:auto;
  margin-right:auto;
  width:780px;
  border: 1px solid black;
}
"#" refers to id's and "." refers to classes. Generally you want to assign id's to unique elements on the page and classes to elements that will share the same properties.

Now there are two types of elements. There is the inline element which takes up only its length on a line and then there is the box element that takes the entire line. You need to know which ones are box and which are inline by default. Later on I will post a link to a table that shows most elements and their display type.
__________________

Last edited by atholon; 07-20-2008 at 12:53 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mature: A Golfing Lesson? bigsmellyfart Humor & Jokes 3 07-29-2009 02:26 PM
CSS Lesson 2 - Header and Body atholon Web design and Programming 0 07-20-2008 12:53 PM
History lesson. Mauser 98K General Chat 2 06-06-2007 10:51 PM
A salutary lesson to us all! BADDOG General Chat 0 08-08-2005 09:45 AM
A Lesson in Life Stalker61 Humor & Jokes 2 08-16-2004 05:54 AM


All times are GMT -5. The time now is 01:14 PM.




Powered by vBulletin®