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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:46:56+00:00 2026-05-30T03:46:56+00:00

In a web page I’ve made, I’ve used a style block to define position:

  • 0

In a web page I’ve made, I’ve used a style block to define position: absolute for a particular id. I also set the top and left items too. This all works fine.

<style>
#vPage { position: absolute; left: 100px; top: 100px; }
</style>

But when I try to read the value using Javascript:
obj.style.position

alert(document.getElementById("vPage").style.position);

Its value is “”

Why is that? How can I check the style of a page element that was set with the style tag and not set with Javascript FROM Javascript?

The browser I’m using is IE7. Any help is appreciated.

  • 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-30T03:46:56+00:00Added an answer on May 30, 2026 at 3:46 am

    use the following function to get the styles across the browsers, el=your element id and cssprop=any style prop

    function getStyle(el, cssprop){
     if (el.currentStyle) //IE
      return el.currentStyle[cssprop]
     else if (document.defaultView && document.defaultView.getComputedStyle) //Firefox
      return document.defaultView.getComputedStyle(el, "")[cssprop]
     else //try and get inline style
      return el.style[cssprop]
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My web page has two ways of displaying a particular content. 1. When the
I have a web page which has a form at the top and a
My web page uses relative urls internally but also I use direct links to
On web page there is a block with some advertise (slideshow of about 3-4
I have a .aspx web page, with a html form within it, this also
Every web page load from top to bottom means first my header will be
That's pretty much it. I'm using Nokogiri to scrape a web page what has
A web page contains lots of image elements: <img src=myImage.gif width=180 height=18 /> But
Summary: web page has a few fields to allow the user to enter payments.
My web page has a countdown snippet which reads its remaining time from a

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.