Jump to content

Using hidden <div>


Roger

Recommended Posts

Wondering if one of you can help me solve this.

 

I'm using multiple hidden <div>'s to display information in a specific spot on an html page.

 

Pretty simple and the execution is clean and fast. The actual function that does the hide and show is a small C function I ran across.

 

The <div> CSS code uses the absolute position property and left/top properties to place the data correctly on the page and z-index of 99 to place on top of all other elements. I discovered that on my monitor it works great. If I test on a flat panel wide screen. The top/left px values are not correct and the data is displayed on top of other data.

 

I thought that maybe using % instead of px at for the top/left would solve the problem. The result is much closer but still not right.

 

Any code guru's have any thoughts on this? How do I account for various screen sizes for the data to display correctly?

 

Thanks,

-Roger

Link to comment
Share on other sites

I had tried that but the display was totally wrong. But, as I type this I'm thinking about that and realize that all I did was change the position property to relative. I didn't put it inside the elements where it needed to be... so I'll try that again.

 

Didn't realize my error until I read the link you provided Bear. Thanks

Link to comment
Share on other sites

solution turned out to be very simple. I was really trying to complicate it.

 

Placing the hidden divisions inside the column elements AND removing the top/left properties altogether AND leaving the position property as absolute. Seems to work.

 

Still wouldn't have found it without that link to jog my noggin.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated