ok, lets say I want a structure that looks like www.yahoo.com
a top bar (title), a left bar (navigation menu), a content pan, a right
bar(actually full of things on yahoo, but I would put publicity) and a
bottom bar (copyrights and such).
I tried to position everything in absolute, but, probably because I'm no
expert with css, I can't seem to make this simple structure work correctly.
Could you give me a little hint please?
div are block elements, so by default they go on seperate lines. to put a
div side by side must be done with a css position command. in general to use
positioning, you need to set absolute heights and widths to divs, so you can
position them correctly. often you want client script to calc offsets based
on screen size.
try;
<html>
<body>
<div
style="background-color:green;position:absolute;left:10;top:10;width:400;height:100;">
top
</div>
<div
style="background-color:red;position:absolute;left:10;top:610;width:400;height:100;">
bottom
</div>
<div>
<div
style="background-color:blue;position:absolute;left:10;top:110;width:100;height:500;">
left
</div>
<div
style="background-color:yellow;position:absolute;left:110;top:110;width:300;height:500;">
right
</div>
</body>
</html>
A couple of good books:
Bulletproof Web Design
CSS Mastery
Stylin' with CSS
Javascript + CSS + DOM Magic
(The books speak to absolute versus relative positioning as well as fluid
versus static design of pages.)
the third link seems to be exactly what I need, so I'll look at it when I
have time... thanks a lot
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.