Positioning etc

allyally2k

Senior Member
Anyone got any good tutorials to break down the use of when to use the different types of positioning and/or floating? I know the basics and I'm just doing it by trial and error at the mo, but would like to know what is the best practice for things like nav bars, footers etc.

Any decent links would be helpful. :D
 
Hi

Here is a link: Learn CSS Positioning in Ten Steps: position static relative absolute float

Two invaluable tips:

Setting Position relative/absolute:

<div id='container' style='position:relative'>
<div id='innerElement' style='position:absolute'>
</div>
</div>

With the above setup the inner element can be positioned anywhere inside the container div - dead useful.

Floating:
When using float you must set the widths of the floated elements and then use margins to position the elements, that's about it!! Don't forget that when adding padding to elements you need to reduce the width of it by the amount of padding, especially if elements butt up to each other.

Hope that helps
 
Back
Top