oo7ml
07-21-2006, 08:16 AM
[ 1 (header)
[______________________________
[
[
[
[ 2 (body)
[
[
[______________________________
This is the layout of my website - is there a way of declaring part (2) so that if i set text to the top, it goes to the top of (2) and NOT to the top of the entire page
How is this done, or what other methods would you use yourself
thanks guys in advance
LiLcRaZyFuZzY
07-21-2006, 08:30 AM
Any links to your current page?
oo7ml
07-21-2006, 08:33 AM
No, i am just putting it together now. I've only started using CSS, (i used to fully depend on dreamweaver). I just want to put a logo and buttons up at the top and have the content underneath
Centauri
07-21-2006, 08:34 AM
<div id="header">
header stuff here
</div>
<div id="content">
content stuff here
</div>
you can then style each section with css as you desire
Cheers
Graeme
oo7ml
07-21-2006, 08:37 AM
I don't really understand that div id, can you explain or let me know where to look for it (apart from google)
Centauri
07-21-2006, 08:43 AM
http://www.htmldog.com/guides/cssintermediate/classid/
http://www.cssplay.co.uk/
http://www.positioniseverything.net/articles.html
http://bonrouge.com/br.php?page=home
http://garyblue.port5.com/
http://meyerweb.com/eric/css/edge/
There's a few !
LiLcRaZyFuZzY
07-21-2006, 08:46 AM
not to forget:
http://www.w3.org/TR/html4/
http://www.w3.org/TR/CSS21/
oo7ml
07-21-2006, 08:57 AM
thanks guys, sorry to be annoying
I guess i need to see a the simplist page in the world with this done
LiLcRaZyFuZzY
07-21-2006, 09:36 AM
Ok,
you'll need to know the basics:
What is HTML, what is valid HTML? What is a doctype definition (DTD)?
What is CSS?
You'll need to know HTML 4.01 tags and where, when and how to use them.
Don't be sorry for anything, keep asking questions
It's easier for us if they're specific.
First step:
this is a standard HTML 4.01 template, you can start all of your web documents by using this:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
</style>
</head>
<body>
</body>
</html>
Later on you'll place your CSS in the style tags (in the head tags of the document)
The rest of the markup (your header and content) should go in the body tags
Ok, 2nd step is to actually write the markup and the content (for "dummy" test content, you can use lorem ipsum text: http://lipsum.com as i did here)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Standard Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
</style>
</head>
<body>
<h1><span>Header</span></h1>
<div id="content">
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vivamus nec augue non libero dictum egestas. Nunc tempus. Phasellus viverra magna vel metus. Integer lorem dui, consectetuer vitae, fermentum sed, ultricies at, enim. Suspendisse convallis. Proin elementum, massa ac vestibulum dignissim, eros risus iaculis lorem, et varius lacus dolor eu lorem. Ut convallis tincidunt metus. Ut lacus nisi, imperdiet nec, suscipit ac, mollis vel, lectus. Nunc mauris. Mauris ullamcorper rutrum sapien. Nulla nibh ligula, egestas sed, consectetuer ac, dignissim non, magna.
</p>
<p>
Pellentesque nec risus. Sed ut velit. Vestibulum in elit sit amet velit tristique elementum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce id nulla fermentum arcu tempus pulvinar. Vivamus interdum massa eget metus. Pellentesque consectetuer sollicitudin nibh. Phasellus faucibus ultrices dui. Sed faucibus neque sit amet lorem. Aliquam ipsum pede, laoreet ac, pellentesque eu, porttitor mattis, ipsum. Phasellus posuere felis et mauris. Curabitur ac neque. Donec tincidunt, nisl vitae pulvinar aliquet, tortor ligula gravida metus, eget lacinia metus lacus non velit. Cras commodo, tellus et nonummy ornare, justo neque mattis quam, et volutpat tortor eros quis arcu. Nullam euismod tortor eu mauris. Praesent pellentesque lobortis nulla. Donec congue.
</p>
</div>
</body>
</html>
3rd step, now you can style it, example:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Standard Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body{
background-color: #ece9d8;
font-family: tahoma, sans-serif;
}
h1{
text-align: center;
font-family: 'trebuchet MS', serif;
font-style: italic;
}
div#content{
width: 25%;
margin: 0 auto;
border: 1px solid black;
padding: 1em;
background-color: #fffff0;
}
p:first-letter{
font-weight: bold;
font-size: xx-large;
font-style: italic;
padding-right: 0.5em;
}
</style>
</head>
<body>
<h1><span>Header</span></h1>
<div id="content">
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vivamus nec augue non libero dictum egestas. Nunc tempus. Phasellus viverra magna vel metus. Integer lorem dui, consectetuer vitae, fermentum sed, ultricies at, enim. Suspendisse convallis. Proin elementum, massa ac vestibulum dignissim, eros risus iaculis lorem, et varius lacus dolor eu lorem. Ut convallis tincidunt metus. Ut lacus nisi, imperdiet nec, suscipit ac, mollis vel, lectus. Nunc mauris. Mauris ullamcorper rutrum sapien. Nulla nibh ligula, egestas sed, consectetuer ac, dignissim non, magna.
</p>
<p>
Pellentesque nec risus. Sed ut velit. Vestibulum in elit sit amet velit tristique elementum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce id nulla fermentum arcu tempus pulvinar. Vivamus interdum massa eget metus. Pellentesque consectetuer sollicitudin nibh. Phasellus faucibus ultrices dui. Sed faucibus neque sit amet lorem. Aliquam ipsum pede, laoreet ac, pellentesque eu, porttitor mattis, ipsum. Phasellus posuere felis et mauris. Curabitur ac neque. Donec tincidunt, nisl vitae pulvinar aliquet, tortor ligula gravida metus, eget lacinia metus lacus non velit. Cras commodo, tellus et nonummy ornare, justo neque mattis quam, et volutpat tortor eros quis arcu. Nullam euismod tortor eu mauris. Praesent pellentesque lobortis nulla. Donec congue.
</p>
</div>
</body>
</html>