Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-06-2008, 12:14 AM   PM User | #1
lpeek
Regular Coder

 
Join Date: May 2007
Posts: 130
Thanks: 9
Thanked 0 Times in 0 Posts
lpeek is an unknown quantity at this point
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
lpeek is offline   Reply With Quote
Old 10-06-2008, 12:20 AM   PM User | #2
jlhaslip
Regular Coder

 
Join Date: Feb 2007
Location: Canada
Posts: 924
Thanks: 10
Thanked 56 Times in 55 Posts
jlhaslip is on a distinguished road
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.
jlhaslip is offline   Reply With Quote
Old 10-06-2008, 12:26 AM   PM User | #3
lpeek
Regular Coder

 
Join Date: May 2007
Posts: 130
Thanks: 9
Thanked 0 Times in 0 Posts
lpeek is an unknown quantity at this point
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; }
lpeek is offline   Reply With Quote
Old 10-06-2008, 06:09 AM   PM User | #4
jlhaslip
Regular Coder

 
Join Date: Feb 2007
Location: Canada
Posts: 924
Thanks: 10
Thanked 56 Times in 55 Posts
jlhaslip is on a distinguished road
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...
jlhaslip is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:02 AM.


Advertisement
Log in to turn off these ads.