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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:04:59+00:00 2026-06-12T09:04:59+00:00

I have a div that acts as a tooltip-like popup when the mouse hovers

  • 0

I have a div that acts as a tooltip-like popup when the mouse hovers over a link. It conceptually has 5 rows: A line of text, a button, a divider, a line of text, a button.

 ----------------
|   Click here:  |
|    [Button1]   |
|   ----------   |
| Or Click Here: |
|    [Button2]   |
 -------  -------
        \/

Each row is currently a div with an image background for its content and it’s all working fine. But now we have a need to display combinations of the top and bottom button conditionally. How can I keep the visible elements vertically centered in the popup div as “rows” are shown or hidden? The popup div needs to have a minimum of 20px padding at the top.

 ----------------  ----------------
|                ||                |
| Or Click Here: ||   Click here:  |
|    [Button2]   ||    [Button1]   |
|                ||                |
|                ||                |
 -------  -------  -------  -------
        \/                \/

I’ve read this: http://www.boutell.com/newfaq/creating/centervertically.html but I’m not sure how to apply it with multiple stacked contents.

  • 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-12T09:05:00+00:00Added an answer on June 12, 2026 at 9:05 am

    Since I’m already using javascript to show or hide the elements, I decided to use it to set the alignment as well. I first attempted to use javascript to intelligently recalculate the top margin to center the content for me. Because of IE’s disregard for standards, that got too messy. So I ended up using javascript to swap out css classes on the divs in order to adjust top & bottom margins and make it look centered instead. The divs are already stacking so if I remove the top div, the remaining ones shift up. So the class I swap in just adds the appropriate top margin to shift the top div down to the center.

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

Sidebar

Related Questions

I have a div that acts as a tooltip, and a link to show
If I have a div that acts like a box, and I make it
I would just like to have an editable div that acts like a textarea
I have a div that acts like a drop-down. So it pops-up when you
I currently have a div that acts like a gallery so to speak. div
I have a div that has a one pixel solid white border on the
Ok so i have a div that acts as a background for two divs(filled
I have a div on my page that acts as a shell to store
I have a div that has two buttons in it that has a jQuery
I have a div that contains the Facebook Like button, Google plusone and an

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.