Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › help with absolute and relative positioning
New Posts  All Forums:Forum Nav:

help with absolute and relative positioning

post #1 of 2
Thread Starter 
hi all,

I need a bit of help, a friend of mine explained this to me a while back but i cant get hold of him at the moment.

I started using absolute positioning as it is massively eaiser than messing about with relative and margins, padding etc.


So i have a relative container div to centre content, margin: 0 auto;

then i have the background div which is white and is absolute and then the content which is mostly absolute.

However as absolute takes stuff out of the flow, if the content within the white background div gets too big (i.e. off the bottom of the page) then it will spill out of the white background.

is there any way of making this white background div expand with the content even though it is all absolute positioned?


My friend mentioned a div property that can be "seen" by relative and absolute divs that you can stick in between the bottom of the content and the background that will sort this out but i cant remember for the life of me what that was.

any help would be great.

also website in question: sixty8.org/team (the white background is currently a few pixels high as i tried to make it work and failed...
    
CPUMotherboardGraphicsRAM
i3 550 MSI P55-GD80 zotac 280 gtx amp edition 4gb crucial 1600 
Hard DriveOptical DriveOSMonitor
2x250gb raid 0 + 500gb WD caviar, 500gb wd blue Optiarc dvd ram windows 7 pro 23" Digimate 1080p 
KeyboardPowerCaseMouse
compaq stealthxstream 600w Antec nine hundred (dropped from desk :s) g500 
Mouse Pad
belkin gel pad 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
i3 550 MSI P55-GD80 zotac 280 gtx amp edition 4gb crucial 1600 
Hard DriveOptical DriveOSMonitor
2x250gb raid 0 + 500gb WD caviar, 500gb wd blue Optiarc dvd ram windows 7 pro 23" Digimate 1080p 
KeyboardPowerCaseMouse
compaq stealthxstream 600w Antec nine hundred (dropped from desk :s) g500 
Mouse Pad
belkin gel pad 
  hide details  
Reply
post #2 of 2
Quote:
Originally Posted by anadalite View Post
hi all,

I need a bit of help, a friend of mine explained this to me a while back but i cant get hold of him at the moment.

I started using absolute positioning as it is massively eaiser than messing about with relative and margins, padding etc.


So i have a relative container div to centre content, margin: 0 auto;

then i have the background div which is white and is absolute and then the content which is mostly absolute.

However as absolute takes stuff out of the flow, if the content within the white background div gets too big (i.e. off the bottom of the page) then it will spill out of the white background.

is there any way of making this white background div expand with the content even though it is all absolute positioned?


My friend mentioned a div property that can be "seen" by relative and absolute divs that you can stick in between the bottom of the content and the background that will sort this out but i cant remember for the life of me what that was.

any help would be great.

also website in question: sixty8.org/team (the white background is currently a few pixels high as i tried to make it work and failed...
Unless given a specific height & width, absolute divs should still expand with their content. Your website doesn't have a doctype as well... sometimes adding one tends to fix things.
iCode
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i5 2500K ASUS P8Z68 Deluxe 2X EVGA DS GTX 580 Superclocked SLI CORSAIR Vengeance 8GB (2x4GB) 
Hard DriveOptical DriveOSMonitor
OCZ Vertex 3 MAX IOPS Edition ASUS DRW Win 7 Ultimate x64 HP ZR30w 
KeyboardPowerCaseMouse
Logitech Ultra-Thin Illuminated Keyboard COOLER MASTER Silent Pro Gold Series 1000W LIAN LI PC-B25FWB Black Logitech MX518 
  hide details  
Reply
iCode
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i5 2500K ASUS P8Z68 Deluxe 2X EVGA DS GTX 580 Superclocked SLI CORSAIR Vengeance 8GB (2x4GB) 
Hard DriveOptical DriveOSMonitor
OCZ Vertex 3 MAX IOPS Edition ASUS DRW Win 7 Ultimate x64 HP ZR30w 
KeyboardPowerCaseMouse
Logitech Ultra-Thin Illuminated Keyboard COOLER MASTER Silent Pro Gold Series 1000W LIAN LI PC-B25FWB Black Logitech MX518 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Web Coding
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › help with absolute and relative positioning