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

  • SEARCH
  • Home
  • 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 700469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:30:05+00:00 2026-05-14T03:30:05+00:00

I’m embarking on a major project, but am stuck on a tiny issue at

  • 0

I’m embarking on a major project, but am stuck on a tiny issue at the very start. I’ll try to be as concise as possible.

I have a PHP script that will be echoing into the footer of the page (the last stuff before </body></html> a bunch of <div>s containing visible buttons and <div>s containing hidden dialog boxes.

The plan is to have the buttons float in the upper-right corner of corresponding <div>s in the main content area of the page. i.e. – button-1 echoed into the footer will float in the corner of content-box-1, and will be tied to the hidden <div> ‘dialog-1’.

I’ll be using jQuery and jQuery UI Dialog throughout the page(s). I’m not sure if that’s particularly relevant to this question, but thought it worth mentioning just in case.

So my question, put simply, is how do I echo a <div class="button">Button 1</div> into the footer with PHP, but have it float in the upper-right corner (with maybe 5px margin) of <div class=content>Content 1 is full of content</div>?

A picture says a thousand words:

alt text

As shown above, I want the little blue gear button things in the corner of content pieces, locked and loaded with hidden <div>s containing dialog boxes.
I’ve found plenty of info on how to float divs on top of divs, but all the examples I saw showed the <div>s in close proximity to each other in the page source; not with a hundred lines of source code between the two <div>s

I’m not sure if the solution is pure CSS, pure jQuery/jQueryUI or a combination of the two.

Any advice will be much appreciated.

Thanks!

  • 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-05-14T03:30:06+00:00Added an answer on May 14, 2026 at 3:30 am

    You will want to set the position of the floating to to:

    position:absolute;
    

    Then set the left and top of the div to some location near the ‘gear’, you can get the position from the position method.

    var node = $('#gear');
    var position = node.position();
    var dialog = $("#dialog");
    dialog.css("left", position.left);
    dialog.css("top", position.top);
    dialog.fadeIn("fast");
    

    Something similar to this might work.

    Edit: This has some flaws, after a resize the dialog will be out of position, the reason you see the original div so close to the ‘gear’ is because they use position:relative on the gear and then position the dialog absolutely.

    When an element is absolutely positioned from within an element that is already relatively or absolutely positioned it is now positioned relatively to it’s parent element rather than the window element

    Dialog is positioned 10px relative to the top left of the #gear div:

    <div style="position:relative" id="gear">
      <div style="position:absolute;top:10px;left:10px" id="dialog"></div>
    </div>
    

    Dialog is positioned relative to the top left of the window:

    <div id="gear">
      <div style="position:absolute;top:10px;left:10px" id="dialog"></div>
    </div>
    

    There is probably no reason not to move the dialog to a position within the gear before it is displayed, just append the dialog within the gear, $(“#gear”).append($(“#dialog”))

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I have a text area in my form which accepts all possible characters from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I would like to count the length of a string with PHP. The string
I have a jquery bug and I've been looking for hours now, I can't

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.