TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
Advertisement
Associates
Associates
techtuts Darkmindz
CSS Tutorials Tutorialsphere.com - Free Online Tutorials
Boston PHP SurfnLearn
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 11-15-2007, 01:59 AM   #1 (permalink)
The Wanderer
 
Join Date: Nov 2007
Posts: 22
Thanks: 1
vuthcam is on a distinguished road
Default Any one clear in Positioning..

I have been using css for about months, frankly, i am still not sure about using Position; absolute, relative, static..:confused:. It's kinda a bad habit, when my layout doesn't satisfy me, i try to change those position around without knowing clearing how to use those. ideas??
__________________
Ijajaja
vuthcam is offline  
Reply With Quote
Old 11-15-2007, 02:27 AM   #2 (permalink)
The Acquainted
 
Join Date: Sep 2007
Location: Arizona
Posts: 114
Thanks: 10
Andrew is on a distinguished road
Default

I just wrote out at least 4-5 paragraphs of information and code explaining what each does, but accidentally hit the back button and lost it all. If I have time later tonight or tomorrow, I'll rewrite it. Though, for now, you can go check out http://www.w3schools.com/css/pr_class_position.asp, as that's basically what I wrote, but more simplified.
Send a message via AIM to Andrew Send a message via MSN to Andrew
Andrew is offline  
Reply With Quote
Old 11-15-2007, 02:33 AM   #3 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 1,587
Thanks: 72
Wildhoney is on a distinguished road
Default

You silly bean, Andrew! I won't jump in and shove Andrew out the way as it was his explanation before mine :) so I do hope you find the time to re-type it! Fundamentally speaking, however, I tend to avoid positioning in the main parts of my code due to several issues that can commonly arise with their usage. I do, however, use them for SEO and accessibility purposes, for instance placing a logo over the text link of the website's name - this is good for SEO because search spiders can read them, and good for accessibility because individuals who are unfortunate enough to blind, their special applications will read the website's name aloud.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 11-15-2007, 02:49 AM   #4 (permalink)
The Wanderer
 
Join Date: Nov 2007
Posts: 22
Thanks: 1
vuthcam is on a distinguished road
Default

Using only one of those alone is ok, but the controversial things happen when trying to use the one inside others..

Thanks for resource Andrew
__________________
Ijajaja
vuthcam is offline  
Reply With Quote
Old 11-15-2007, 06:04 AM   #5 (permalink)
The Acquainted
 
wGEric's Avatar
 
Join Date: Nov 2007
Posts: 125
Thanks: 0
wGEric is on a distinguished road
Default

This use to confuse me in the past and I thought this would be a good blog topic so I wrote a blog on it, http://www.ericfaerber.com/2007/11/1...tion-property/

Quote:
Some people have a hard time figuring out the position property in CSS. It took me a while to fully understand it and use it to it’s full potential. Here is some information on it and hopefully you can understand it.

position: relative; positions the element relative to it’s nromal position. An elements normal position is its position in the flow of the page. So top: 5px and left: 30px; will move it down 5 pixels and left 30 pixels from it’s normal position on the page.

position: absolute; moves it to a certain spot within the first parent element that has been positioned before it. This is where it gets tricky. This defaults to the browser window if you haven’t positioned any parent elements. Examples will make this easier for me to explain.

<h1>Positioning Example</h1>
<div style="width: 500px; height: 500px; border: 1px #000000 solid;">parent element
<div style="position: absolute; bottom: 0px; left: 0px">child element</div>
</div>
View Example

In this example, child element will be in the bottom left corner of the browser window although the parent element doesn’t go below 500 pixels or the window is shorter than 500 pixels. The child element will be in the bottom left corner of the browser window even if you can scroll below the page.

<h1>Positioning Example</h1>
<div style="width: 500px; height: 500px; border: 1px #000000 solid; position: relative;">parent element
<div style="position: absolute; bottom: 0px; left: 0px">child element</div>
</div>
View Example

In this example, child element will be in the bottom left corner of the parent element. This is because parent element has now been positioned so it becomes the containing block and position: absolute will move elements around within that block.
__________________
Eric
BlogphpBB
wGEric is offline  
Reply With Quote
Old 11-15-2007, 11:02 AM   #6 (permalink)
The Acquainted
 
Join Date: Oct 2007
Posts: 126
Thanks: 12
maZtah is an unknown quantity at this point
Default

You definiately should read the tutorials on the following website!

http://www.htmldog.com/guides/
maZtah is offline  
Reply With Quote
Old 11-15-2007, 12:59 PM   #7 (permalink)
The Wanderer
 
Join Date: Nov 2007
Posts: 22
Thanks: 1
vuthcam is on a distinguished road
Default

Thanks everybody!! Your resources are really helpful!! I got many clues from those.
__________________
Ijajaja
vuthcam is offline  
Reply With Quote
Old 11-15-2007, 02:01 PM   #8 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 1,587
Thanks: 72
Wildhoney is on a distinguished road
Default

Great post, Eric. The CSS positions used to baffle me as well.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 08:19 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0