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 7 of 7
  1. #1
    Regular Coder
    Join Date
    Dec 2010
    Location
    California
    Posts
    201
    Thanks
    30
    Thanked 8 Times in 8 Posts

    Keeping an element in a fixed position, within another div

    Hello,

    I am trying to keep and element in a fixed position while it sits in a div that has a position of relative and is sitting center at 964px. The left burgundy panel is what I'm trying to have sit in the position its already in, but fixed. Does anyone know how i can achieve this.

    div#lp sits within div#inner, although a fixed position takes it out of div#inner

    Link

    http://experiencemediaonline.gorillaonemedia.com/work/

  • #2
    Regular Coder
    Join Date
    May 2009
    Posts
    813
    Thanks
    123
    Thanked 24 Times in 24 Posts
    Looks fine to me in FF

  • #3
    Regular Coder
    Join Date
    Dec 2010
    Location
    California
    Posts
    201
    Thanks
    30
    Thanked 8 Times in 8 Posts
    well this is because I still have the position set to absolute. when i change it to fixed it jumps out of the div and sits against the left wall of the browser

  • #4
    Regular Coder
    Join Date
    Dec 2010
    Location
    California
    Posts
    201
    Thanks
    30
    Thanked 8 Times in 8 Posts
    this is what I am trying to achieve, see how the panel is fixed, but yer in the middle of the screen. How do i get my burgundy panel to do the same??

    Link I'm trying to achieve: http://btemplates.com/2010/blogger-t...e-oulipo/demo/

    My link: http://experiencemediaonline.gorillaonemedia.com/
    Last edited by eberdome; 02-17-2011 at 07:08 PM.

  • #5
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,335
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Did you try this? One thing to mention though. You wont see much fixed position on that div when your page content is so short. If you have some pages that will increase in height(content) then you will see the effects.

    Code:
    div#lp {
        background: none repeat scroll 0 0 #2C0203;
        height: 390px;
       /* left: 0;*/
       /* margin: 0;*/
        margin-top: 131px;
        padding: 0;
        position: fixed;
        width: 180px;
    You said when you changed position to fixed it "jumped" out and nestled up against the left wall. Thats because you have a margin and left position of 0 in the style. You can see I commented out that margin and the left: 0; as well.
    Last edited by teedoff; 02-17-2011 at 07:19 PM.
    Teed

  • Users who have thanked teedoff for this post:

    eberdome (02-17-2011)

  • #6
    Regular Coder
    Join Date
    Dec 2010
    Location
    California
    Posts
    201
    Thanks
    30
    Thanked 8 Times in 8 Posts
    teedoff,

    That worked splendid! Thank you so much!!

  • #7
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,335
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Quote Originally Posted by eberdome View Post
    teedoff,

    That worked splendid! Thank you so much!!
    You're welcome. Actually, you could float that div left and instead of top:131px; change it to

    margin-top: 131px;
    Teed


  •  

    Tags for this Thread

    Posting Permissions

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