Roger Posted June 20, 2007 Share Posted June 20, 2007 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 0 Quote Link to comment Share on other sites More sharing options...
bear Posted June 20, 2007 Share Posted June 20, 2007 Couldn't you make it relative to the containing div it lives inside of instead of positioning by the window or screen? I can't find the reference just now, but I've seen it done (was either dynamic drive or...?). Good info here: http://alistapart.com/articles/flexiblelayouts/ 0 Quote Link to comment Share on other sites More sharing options...
Roger Posted June 20, 2007 Author Share Posted June 20, 2007 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 0 Quote Link to comment Share on other sites More sharing options...
bear Posted June 20, 2007 Share Posted June 20, 2007 Happy to help. Let us know how you make out. 0 Quote Link to comment Share on other sites More sharing options...
Roger Posted June 21, 2007 Author Share Posted June 21, 2007 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. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.