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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:58:15+00:00 2026-05-30T13:58:15+00:00

The scenario is that I want to insert a number, which is placed in

  • 0

The scenario is that I want to insert a number, which is placed in a <div>, over an image(z-index of image= -1).I have an image inside my anchor tag. I’ve found out the Top and Left positions of the anchor tag (id = PersonalInfo), then I’ve set the position of the <div> to fit in the center of the image.But the number shows somewhere on the extreme right of the browser window, and a little below the image. How do I get it in the proper position.
Also, I want to know how to get the top and left co-ordinates of any element with respect to the browser window’s borders (not including the toolbar at the top).

 <a href='#' id='PersonalInfo' class='links' disabled='disabled' name='1' ><img src='../Images/COBreadCrumb/disabled.gif'></a>

The Jquery code I wrote for it is this:

var number = $("#PersonalInfo").attr("name");
          var tag1 = "<font style='Verdana' size='3'>";
          var tag2 = "</font>";
          var content = tag1 + number + tag2;
          $("#" + number).html(content);
          var LinkTop = $("#PersonalInfo").offset().top;
          var LinkHeight = $("#PersonalInfo").height();
          var NumberTop = LinkTop + (LinkHeight / 2);
          var NumberLeft = $("#PersonalInfo").offset().left + ($("#PersonalInfo").width() / 2);
          $("#" + number).offset({top:NumberTop,left:NumberLeft});

 The div tag:

<div id="1"></div> 
  • 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-30T13:58:16+00:00Added an answer on May 30, 2026 at 1:58 pm

    Becase Richard beat me to the punch, and as bazmegakapa points out, the table-cell trick is fail in IE7, here’s another solution:

    <!doctype html>
    <html>
    <head>
    <title>Center</title>
    <style>
    #meme {
      background: url(http://thechive.files.wordpress.com/2010/12/funny-cat-faces-8.jpg?w=500&h=374);
    
      /* same size as background image */
      width: 500px;
      height: 374px;
    
      /* #meme-text will be positioned relative to this */
      position: relative;
    }
    
    #meme-text {
      /* The height of this element will be approximate 60px too,
       * assuming the content will fit on one line.
       */
      font-size: 60px;
    
      /* Center vertically <- This is the tricky part. */
      position: absolute;
      top: 157px;  /* #meme height / 2 - height of this element */
    
      /* Center horizontally */
      text-align: center;
      width: 100%;
    
      /* Make this example look pretty. */
      color: white;
      font-family: Impact, sans-serif;
    }
    </style>
    </head>
    <body>
    
    <div id="meme">
      <div id="meme-text">I NOM YOUR FACE</div>
    </div>
    
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario I have a stored procedure written in T-Sql that I use to insert
I have the following scenario: a table that is accessed (update, delete, insert and
I came in to scenario that I want to trigger service on specific time.
I want to ask about an edge-case scenario that I understand is very poor
SCENARIO: Given that a model called Edition has its community feature enabled I want
I have a scenario that looks like this: #include <algorithm> using namespace std; //
Lets assume a scenario that i have a remote, a developer1 and a developer2.
I have a scenario that my load balancer translates port 80 from outside into
I have a scenario that I haven't been able to solve: I'm toying around
I have a scenario that, I am creating dynamic html content and I need

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.