Html

quagmondo23

New Member
I am getting to the stage of creating sites with html. I want to have a navbar on top and text in the middle of the page. How do i position things?
Oh, and i use css. I find position:absolute takes to much time and effort
 
You have two options:

1) Frames: users can resize them, it looks ugly, bad choice. <frames>

2) Tables: This is the most common used skeleton of websites.
Here is a tutorial:
http://www.w3schools.com/html/html_tables.asp


I never used CSS so I can't help you on this but you don't have and I don't think you can code everything in CSS...
 
tables are quick and easy, but arent a great way to build a website, they make it slightly slower to load etc...

with CSS you need to make sure you are seperating the Code into sections (e.g. Top, Maintext, Navbar, Footer etc...) then you can use the CSS code to float the navbar to the left (or top), add padding etc...

also use CSS for any colour / fonts you use.
 
By separating the code, do you mean mentally? If not, how?

I am just learning CSS and am trying to get to grips with it.
 
by using code such as (this goes in the HTML doc)

Code:
<div id="content"></div>

you can then make an Id selector section in your css code such as (this goes in the CSS doc)

Code:
#content{
	font-family: arial;
	text-align: left;
	padding-right: 2em;
	margin-left: 12em;
}

from this you can choose where to put your Navbar etc on the page. though if you want to do it with tables etc... youre better off using dreamweaver (or similar)... and doing it all in HTML.

make sure you use the w3schools website to help, its very useful.
 
its division, it doesnt do much to the screen, it just allows the HTML doc to be broken up into parts, then using CSS you can control these parts seperately, giving them different styles, positions etc... the only thing that will make this change the appearance of what is shown on the screen is the CSS.
 
So, is div just like giving html class things.
Code:
<p class="black">hello</p>
and then in a css document

Code:
p.black {color:#000000}
 
yeah the <div> and css is the way to go

frames are sooo archaic

and tables get really messy in code (not that its hard to keep up with that), but div is just nicer and lets u control ur whole site from one main page
 
Without a doubt, div's generally make nicer code but I've always found a bunch of tables much faster to set up and keep going. Frames are indeed evil.

Forums typically use tables because of the way everything is presented, it lends itself to it very well. Could anyone imagine trying to make a long series of posts with div tags? I believe phpbb3 does, but has anyone ever called phpbb's html output nice? :P
 
Last edited:
Back
Top