Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    May 2007
    Posts
    130
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Simple positioning problem..

    Hey Hey,

    im working on a site and have come across a wee problem...

    I have a coloured bar that goes right the way across the page at the bottom, 50px from the bottom... I want it to always be this distance which i have achieved with position:absoloute...

    but the problem is if the users screen is small, or they have resized the browser window the coloured bar overlaps the content of the page as its positioned absoloute to the page...

    how could i get it to stay the 50px from the bottom... unless it reaches the bottom on the main content div? then it stays there and goes off the screen?

    any ideas?

    Regards

  • #2
    Regular Coder
    Join Date
    Feb 2007
    Location
    Canada
    Posts
    924
    Thanks
    10
    Thanked 56 Times in 55 Posts
    Without seeing any code, I would say you are looking for position: fixed.
    Or maybe a margin-bottom? or padding-bottom?
    Can't say for sure without a link to the page or the code being posted.

  • #3
    Regular Coder
    Join Date
    May 2007
    Posts
    130
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Ah yess silly me...

    link to the site: libertysnails.users50.webfusion.co.uk

    and the code for the main wrap and for the coloured bar:

    Code:
    div#wrap { width: 850px; left:50%; margin-left: -425px; position:relative; float: left; }
    
    div#PinkBar { width:100%; height:28px; background-color:#f4018b; position:relative; bottom:30px; left:0px; }

  • #4
    Regular Coder
    Join Date
    Feb 2007
    Location
    Canada
    Posts
    924
    Thanks
    10
    Thanked 56 Times in 55 Posts
    So, you want it so that the pink bar is 'always' 50 px up from the bottom of the viewport?

    Check this link out.

    Fixed position for modern browsers AND IE6...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •