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 8039511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:35:39+00:00 2026-06-05T03:35:39+00:00

As images say more than 1000 words, here’s my problem (note: I can’t post

  • 0

As images say more than 1000 words, here’s my problem (note: I can’t post images because I don’t have enough SO reputation, so I’ll post a link):

http://s7.directupload.net/images/120604/skhgwuqb.png

Here’s the use case:
The black, surrounding div is a page preview. The blue divs inside the black div are sections of this page. The blue divs outside are “edit” buttons. They should have the same vertical position as their correspondants.

because the black div and it’s contents are a page preview, I cannot move the edit buttons inside the div (without altering the page template to have “edit” buttons, which of course is bad by design).

How can I align them? If Javascript is necessary to achieve this, it will be okay, although I strongly favor a CSS solution.

  • 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-05T03:35:40+00:00Added an answer on June 5, 2026 at 3:35 am

    I am not aware of a CSS-only way to achieve what you want if you can’t touch anything in the surrounding div. Here’s a jQuery solution:

    http://jsfiddle.net/BuS2p/

    <!doctype html><html><head>
    <script src="/path/to/jquery.js"></script>
    <style>
    #surrounding_div {
     width: 400px;
     height: 400px;
     position: relative;
     background: blue;
    }
    
    #elm1 {
     width: 150px;
     height: 150px;
     background: red;
     position: absolute;
     left: 20px; top: 20px;
    }
    
    #elm2 {
     float: left;
     width: 350px;
     height: 100px;
     background: green;
     float: left;
     margin-top: 150px;    
    }
    </style>
    </head><body>
    <div id="surrounding_div">
      <div id="elm1">Testing</div>
      <div id="elm2">Testing</div>
    </div>
    <script>
    jQuery(function() {
        $('#surrounding_div div').each(function() {
            theDiv = $(this);
            divOffset = theDiv.offset();
            $('<button>Edit</button>').appendTo('body').css({
              'left' : $('#surrounding_div').width() + 20,
              'top' : divOffset.top,
              'position' : 'absolute',
              'z-index' : 9000
            });
        });
    });
    </script></body></html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let say, I have a web application that allows users to upload images and
Suppose I have any image(say passport type images where the background will be same
If we have two tables, say; users, and images, how do we select users
I have trying to get around making my first C# application(that can do more
I have images on my website where the user can download selected images. When
Say i have 10 small images that i want to use as tooltips. Im
here's the problem: I have a custom hardware device and I have to grab
Can I Store more than 1 type in the Clipboard? Eg. like Text &
So say I've got a series of images created with a php loop ->
Ok, lets say I go to http://www.google.com/intl/en_ALL/images/logo.gif , which is not really a document,

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.