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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:30:08+00:00 2026-05-11T19:30:08+00:00

How to make a bookmarklet where there’s a div that pops up in the

  • 0

How to make a bookmarklet where there’s a div that pops up in the middle of the screen?

Seems very simple, i just can’t get it down.

  • 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-11T19:30:08+00:00Added an answer on May 11, 2026 at 7:30 pm

    To make a div appear in the middle of the screen, you need two divs, one inside the other:

    • The outer div is has fixed position at top 50%; left: 0px; right 0px; height: 1px and overflow: visible
    • The innder div is absolutely positioned to left: 50%, top: minus the height of the div and has a margin-left of minus the width of the div. That is:

    #

    <div id="outerDiv">
       <div id="innerDiv">
          Your content
       </div>
    </div>
    
    #outerDiv
    {
        position: fixed;
        top: 50%;
        height: 1px;
        left: 0px;
        right: 0px;
        overflow: visible;
    }
    
    #innerDiv
    {
        position: absolute;
        width: 200px;
        height: 100px;
        left: 50%;
        margin-left: -100px;
        top: -50px;
    }
    

    Don’t forget that IE6 doesn’t support position: fixed so you might want to fall back to position: absolute and scroll to the top of the page if you detect IE6.

    As for the bookmarklet: you need to write javascript that constructs these elements and append it to the bottom of the page. Here’s a detailed tutorial on adding elements to a page with javascript.

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

Sidebar

Related Questions

I'm trying to make a snippet of javascript that can get a list of
I am trying to make a bookmarklet that when clicked will check the URL
I'm trying to make a JavaScript bookmarklet that will act as a highlighter, changing
Make things as simple as possible, but no simpler. Can we find the solution/s
I've just created a simple bookmarklet to load a URL containing a generated string.
Here's how I make develop a bookmarklet: I write a javascript function, pass that
I have a bash script that tests whether the sftp connection exists, very simple
I read about a gem months ago that implements a simple DSL to make
I am trying to make a bookmarklet that will return a user id for
I am trying to make a bookmarklet that opens a popup window. Inside this

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.