View Full Version : Positioning help needed

02-02-2005, 05:25 PM

I want to have the hover images of the top menu to stay at the place they currently are, but on all resolution. It only works on 1024x768 at the moment. Any help would be greatly appreciated.

02-02-2005, 05:49 PM
#menu a:hover img {
position: absolute;
top: 0px;
right: 206px;
width: 120px;
height: 100px;

#menu a:hover>img {
right: 217px;

I dont understand the two of these are in your stylesheet. It seems like it's a duplication of a sort, though I could be wrong.

Anyway, I think the position:absolute is the difficulty with the positioning of the images. perhaps removing that attribute and making the image float right? Cant be sure it'll work but thats what I would try firstly.


02-03-2005, 09:05 AM

I dont understand the two of these are in your stylesheet.
I think that's a CSS hack to serve more compliant browsers -ones that understand the child selector- the correct value for "right".


First of all, what is going wrong? I reduced my window width to your layout's width (from max. on 1024x768) and everything stayed in place perfectly (oh, using IE6.0/win2000 here).

To be certain, you could position the images in relation to the "top" div; at least, that one has constant dimensions. give it a position: relative and it should function as a positioning parent for your images.

02-03-2005, 04:16 PM
ronald66, Thanks for that.

As for the problem, it doesn't seem to show itself in 1024 no matter what size the window. If set to 800x600 the images however, are more to the left - about I reckon, 200px; The only reason I can think for this is that, positioned absolutely, fixes the place of the rollovers in the window. As we change the res to 800x600, that distance shows itself to be bigger because 200 px is a higher % of 800 than it is of 1024 ensuring that the gap looks wider. Add to this the fact that 200 px looks bigger in 800 than in 1024 and the bigger gap might be explained fully.

My suggestion, is to use percentages and to bin absolute. Use relative positioning or leave out the positioning element altogether.

hth Bazz

02-03-2005, 11:01 PM

I just tried it on 800x600 and it's fine. A pixel is a pixel is a pixel, I don't see why absolute positioning wouldn't work (as it seems to be).

Percentages would be the wrong way to go here... I mean, if the wrapper were 800px wide, and the image was 25px from the right, why would that change at different resolutions?

02-04-2005, 03:49 PM
Yeh, I have just tried it agian and it is fine today so it seems Jero got a fix and hasn't let told us how.

I notice though, that he/she changed the positioning from absolute as I suggested :) Perhaps a coincidence that it is now working? Hmmmm