Log In · Register

 
 
Closed TopicStart new topic
Problems..
Lotion
post Oct 2 2008, 10:40 AM
Post #1


Newbie
*

Group: Member
Posts: 1
Joined: Oct 2008
Member No: 688,710



Hey there, I'm working on creating my first DIV layout but im having problems. Whenever I use "position:absolute;" in a div, window resizing and also screen resolution will stuff up the layout.

So I decidid to try "position:relative;" and this seemed to do the trick BUT when making the aboutme div for content etc. it would cause the page to stretch if the height was too large, evn though it was only about 300px and was nowhere near the bottom of the page.

Anyone able to help? thanks biggrin.gif
 
Mickey
post Oct 2 2008, 12:31 PM
Post #2


Treasure Pleasure
********

Group: Head Staff
Posts: 11,193
Joined: Oct 2005
Member No: 281,127



Absolute positioning should work. Try positioning it this way:

CODE
<div style="position:absolute; left:50%; margin-left:#px; top:#px;">

Replace the number signs according to where you want your DIV to be. If that doesn't work, please post a link to your page along with the codes that you're using.
 
RyanChronicles
post Oct 2 2008, 01:44 PM
Post #3


HAHA I love korn!
***

Group: Member
Posts: 85
Joined: Feb 2008
Member No: 618,986



Or check out this cool tutorial for positioning

quick lesson on "position: relative"

top: -45px = moves up 45px
top: 45px = moves down 45px
left: -15px = moves left 15px
left: 15px = moves right 15px

quick lesson on "position: absolute"

top: 0% = moves to top of page
top: 50% = moves to middle of page
top: 100% = moves to bottem of page
left: 0% = moves to left of page
left: 50% = moves to center of page
left: 100% = moves to right of page
margin-left: -15px = moves left 15px
margin-left: 15px = moves right 15px
margin-top: 45px = moves down 45px
margin-top: -45px = moves up 45px
 

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: