CSS positioning problems

Status
Not open for further replies.
I'm playing around with the ArsWare design to learn some more CSS design and to generally improve the layout. I've stumbled onto some problems I just can't seem to get around.

I'm trying to create a CSS roll over for the software links, so people get a short description of the application when they hover their mouse over the it. I've managed to get it working to some extent, that is, I can display the popup correctly. The problem is the positioning of it. I can only make it work when I use absolute positioning.

The page I'm working on is here (hover over the CoolMon link), this is the CSS code I'm using to display it:
code:<HR>
Code:
DIV#bodyLeftColumn a span {
	display: none;
}
DIV#bodyLeftColumn a:hover span{
	display: block;
	position: absolute;
	top: 35px; 
	left: 100px; 
	width: 125px;
	padding: 5px; 
	margin: 10px; 
	color: #000; 
	background-color: #f4f4f4; 
	border: 1px solid #ff9400;
	font: 10px Verdana, Arial, Helvetica, sans-serif;
	text-decoration: none;
	text-align: center;
}

In this case, the block breaks out of its parent element, and is correctly overlayed over the other windows (using a z-index).

The problem is that using absolute positioning is unhandy in a long list of links, because the popup is always displayed in the same place. So I want to have it offset just to the right of the link it is associated with. To do this, I used this code:

code:<HR>
Code:
DIV#bodyLeftColumn a span {
	display: none;
}
DIV#bodyLeftColumn a:hover span{
	display: block;
	position: relative;
	top: 0px; 
	left: 100px; 
	width: 125px;
	padding: 5px; 
	margin: 10px; 
	color: #000; 
	background-color: #f4f4f4; 
	border: 1px solid #ff9400;
	font: 10px Verdana, Arial, Helvetica, sans-serif;
	text-decoration: none;
	text-align: center;
}

But now the element stays part of the parent element, pushing the border of the left column out of the way, like you can see
here.

Is there any way I can get around this witout having to resort to some Java script?

BTW, this doesn't work in Opera, but as it doesn't break anything I can live with that.
 

Fluogen

Ars Tribunus Angusticlavius
7,268
I'm guessing that the problem is in the margin and padding settings. Those are the ones that give me the most problems. Try lowering those a bit and see what happens.

One other thing with your first implementation. When I hover over the link the box with the extra info shows up fine but where it overlays the center column it doesn't go away when I move the mouse away. The only way it goes away is to refresh the window some how. I'm using IE 5.5 for reference.
 

Kurt

Ars Tribunus Angusticlavius
8,820
Subscriptor++
Set position: absolute and remove the top attribute:

code:<HR>
Code:
DIV#bodyLeftColumn a:hover span{
	display: block;
	position: absolute;
 
	left: 100px; 
	width: 125px;
	padding: 5px; 
	margin: 10px; 
	color: #000; 
	background-color: #f4f4f4; 
	border: 1px solid #ff9400;
	font: 10px Verdana, Arial, Helvetica, sans-serif;
	text-decoration: none;
	text-align: center;
	filter:progid:DXImageTransform.Microsoft.Shadow(color='gray', Direction=135, Strength=2)
}
 
This is what it looks like in IE6, Mozilla 0.9.7 and Opera 6 respectively:

aw_ie6.gif
aw_moz.gif
aw_opera.gif



All columns line up perfectly in those browsers, there are only two things that render slightly differently: IE6 renders the little news corner image 1 pixel too high and Opera places the line under the headers like Utilities two pixels higher than the others. I can live with those anomalies (unless someone has an idea to fix them).

IE5.5 seems to be causing some other rendering problems and I'm unsure whether to attempt solving those. If I take the CoolMon sitestats as a reference, about 85% of the visitors use IE6 and about 12% uses IE5.x, the rest is taken up by the other browsers.

I think 12% of the visitors is too much to leave the pop-ups in, so if I can't fix it, I'm going to take them out...
 
Status
Not open for further replies.