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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:41:08+00:00 2026-05-12T10:41:08+00:00

Actually in the center of current view, above all other objects. Cross-browser and without

  • 0

Actually in the center of current view, above all other objects.
Cross-browser and without 3rd party plugins and etc.

Via CSS or Javascript

UPDATE:

I tried to use Javascript’s Sys.UI.DomElement.setLocation() but this positioning object not in absolute location but relative to it’s parent.
Is there a function to put in absolute location?

  • 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-12T10:41:08+00:00Added an answer on May 12, 2026 at 10:41 am

    To have it center in the browser, regardless of the page scroll (which is probably what you want), position: fixed will be more reliable. Amending mike108’s code:

    <style type="text/css"> 
    .centered {  
      position:fixed;
      z-index: 100;  
      top:50%;  
      left:50%;  
      margin:-100px 0 0 -100px;  
      width:200px;  
      height:200px;  
    }  
    </style>
    

    This assumes you have a fixed size box you are showing. If you don’t have a fixed size box, you’ll need to use Javascript to measure the window and the div and position it explicitly (again, fixed is probably the way to go).

    Do test on all your browsers, though. There may be something we’re not thinking of.

    I’d actually recommend you look at one of the Javascript plugins that does this, at least for a starting point. They have figured it out, even if you don’t want to use their code. I think I used jqModal as a starting point.

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

Sidebar

Related Questions

Actually i wanna show the JinternalFrame in the center of the JDesktopPane and i
Actually I wish to do the Image Crop or Resize, etc with my picture
How can I define a define float as center in css? actually i need
How can I align the entire script to center? I've never actually coded before
I need to center a imageview on the screen, but programatically, without using XML
Actually I am developing one application in that when application run first time it
Actually I am new to jquery as well as web designing Now I need
actually i am displaying a pop up with ok cancel button when user clicks
Actually I have to take the sequence number in $Revisions field.
Actually I am working on this for the last 3 or 4 weeks but

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.