Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Senior Member shoffman3572's Avatar
    Join Date
    Jul 2008
    Location
    Fullerton, CA
    Posts
    137
    Member #
    16990
    I'm trying to get a div to be 1005px wide and be centered on the screen at the bottom of the web page. And stay there regardless of anything else that's on the screen.

    Here's the CSS:

    #cart { position: fixed; width: 1005px; height: 100px; top: auto; bottom: 0; left: auto; right:auto; z-index:3000; }

    this works in FF and Safari but not in Chrome and IE 8.0 ??

    Any ideas?

  2.  

  3. #2
    Member
    Join Date
    Dec 2010
    Location
    Birmingham
    Posts
    52
    Member #
    25366
    if its not centering, then try margin-left: auto; margin-right: auto;
    if its not at the bottom, it could be because you've not specified pixels (bottom: 0px)

  4. #3
    Senior Member shoffman3572's Avatar
    Join Date
    Jul 2008
    Location
    Fullerton, CA
    Posts
    137
    Member #
    16990
    I tried that and it didn't work.

    I did come up with another solution though.

    I enclosed that div with this:

    div style='margin:0px auto; padding:0px; width:1005px; height:auto;'>

    fixed area here.

    </div>

    And that did the trick. probably not the best way - but it works.

  5. #4
    Senior Member Dorky's Avatar
    Join Date
    Jun 2009
    Location
    Destin Florida
    Posts
    1,430
    Member #
    19103
    Liked
    4 times
    .test { position: fixed; width: auto; bottom: 0px; left: 0px; right: 0px; }
    <div class='test'>Testing</div>

    then position the 1005px content centered inside this using display: block; width: and margin:

    while($get_it !== true){ continue; }


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:13 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com