Click to See Complete Forum and Search --> : Positioning Boxes
Hi ;)
In reference to positioning boxes etc I understand the meanings of Float and Absolute positioning --- but i cannot find out what relative positioning means -- :confused:
Can you help please --- :)
ray326
10-02-2004, 06:02 PM
Here's the top item returned from Googling css relative position.
http://www.w3.org/TR/REC-CSS2/visuren.html#positioning-scheme
Hi -
I'd recommend getting to know 'relative' because
it's a much more flexible way to tweak your layout
than absolutes are. [Humble Opinion]
Let's say you've got a paragraph that's floated left,
and an image that also is floated left to bump up next
to it, and a clear:none; element below them. The image
is a .gif and you want to tweak where it sits to emphasize
something or other...
You could either increase or decrease its padding/margins
to move it a bit, &/or use relative positioning. After
position:relative; you'll then do a top: right: bottom:
&/or left: the length or percentage you enter will
offset the image from that side.
So, let's say you want it to be towards the top of the
page, you'd use top:-5%; and if it needs to go down,
then top:5%;. This takes the element and moves it from
its original position. In contrast:
An absolute takes it out of its regular positioning
altogether and the top: left: , etc. refer to where it
will go in comparison to the browser window.
Hope that helps,
El
Hi LJK/
Thanks very much --mate,that gives me a far better insight into the relative positioning,i appreciate the time you took in helping me :)
It is more difficult to explain than absolute and float -- a tricky one.
Thank you very much :cool:
Thanks Ray
For your google link :)
Have a nice day to you both