Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8542709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:07:55+00:00 2026-06-11T12:07:55+00:00

I have no idea how to title this properly, but here is my problem:

  • 0

I have no idea how to title this properly, but here is my problem:

I have this layout:

<html>
<body>
    <div id="content">this is my page</div>
    <div id="button">magic button</div>
</body>
</html>

css:

#button {
  position: fixed;
  bottom: 20px;
  background-color: #f00;
  padding: 5px;
  left: 50%;
  margin-left: 250px;

}

html, body{
  height: 100%;
}
#content {
  margin: 0 auto;
  width: 700px;
  min-height: 100%;
  background-color: #eee;
}​

See fiddle here: http://jsfiddle.net/n6UPF/

image

My page works just as I want it, the button is exactly where I want it to be.

But if I change the text on my button, it is no longer positioned properly.

I would like to position it “fixed” relative to the right edge of my content area.

Can this be done in pure CSS?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:07:56+00:00Added an answer on June 11, 2026 at 12:07 pm

    If modifying the HTML is acceptable, you can use a wrapper:

    <div id="button-wrapper">
        <div id="button">magic button</div>
    </div>
    
    #button-wrapper {
        bottom: 40px;
        left: 50%;
        margin-left: 350px;
        position: fixed;
    }
    
    #button {
        background-color: red;
        padding: 5px;
        position: absolute;
        right: 10px;
        white-space: nowrap;
    }
    

    http://dabblet.com/gist/3740941

    No, it’s not really pretty, but…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Crappy title, yes. But I honestly have no idea what this particular line of
I have a major problem getting this to work properly. Here is the deal.
I'm sorry, I have no idea how to title this question. I've written an
This seems incredibly simple but I have no idea why I can't put a
Firstly, i am sorry if the title does not properly describe my problem, but
First of all, I have no idea if the title even reflects my question.
First off - apologies for the poor title, I have no idea how to
First of all, excuse my poor topic title. I simply have no idea how
Any body have idea how to put controls dynamically in asp.net 3.5 ? if
I have asked this question earlier today but I didn't provide enough information and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.