|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Barefoot on the Moon!
Staff
Premium Member
Join Date: Aug 2002
Location: Northeastern USA
Posts: 13,385
|
I have an image I am trying to align over a table with sliced images. I'm uzing the z-index to make the image appear above everything. That works.
Now, this image is placed at the top of the page, so when I use relative positioning and top: 824px, it leaves a space where the image was origonally place. Absolute positioning does not seem to do this, but does not want to vertically center either. Is there a way to center vertically with absolute positioning? Thanks.
__________________
There are two secrets to staying young, being happy, and achieving success. You have to laugh and find humor every day, and you have to have a dream.
|
|
|
|
|
|
#2 |
|
Member (9 bit)
Join Date: Dec 1999
Location: Midland, NC, USA
Posts: 292
|
You would use left: nnnpx.
Tricky part is calculating what "left" should be. You can take the width of the window, minus the width of the image, and divide the result by two. Problem is, you're probably dealing with users' different resolutions (different browser widths) and people who don't use full-screen mode for their browsers. As the browser width changes, your "left" should change so the calculation will cause the image to be positioned correctly. By the way, the issues above can also affect your "top" position as well. If someone's resolution or browser window size is low enough for your page to need to scroll, the image will stay put relative to the window as the user scrolls. |
|
|
|
|
|
#3 |
|
Barefoot on the Moon!
Staff
Premium Member
Join Date: Aug 2002
Location: Northeastern USA
Posts: 13,385
|
Tried that.
The problem is that there is a large amount of users for this page at both 800x600 and 1024x768. I tried using percentages instead of pixel measurements, but it still didn't center right at different resolutions. The image is flush against the top when layered. ![]() Yes, there is scrolling envolved, but there doesn't seem to be a problem with that with either absolute or relative positioning. btw, why would there be a space left where the image was after relative positioning? If there wasn't, I'd be using that. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|