Click to See Complete Forum and Search --> : problems positioning right


k0r54
02-20-2005, 05:08 AM
Hi,

I have a small problem when i use this code:

#login {
position:absolute;
top:108px;
height:91px;
width:145px;
right:0;
border-left-color:#CCCCCC;
border-left-style:solid;
border-left-width:1px;
border-bottom-color:#CCCCCC;
border-bottom-style:solid;
border-bottom-width:1px;
background-color:#F5f7f7;
padding-right:4px;
z-index:600;
}


I get a problem where in firefox, opera and ns it is fine, but in IE it is 1px away from the right margin. If i set right to -1px then it puts a horizontal bar on the other 3 browsers?

Any ideas why this is happening.

k0r54

Fang
02-20-2005, 05:18 AM
Need the full document to see the problem.

k0r54
02-20-2005, 05:21 AM
Hi, the code is here

http://dnet.apc-compunet.co.uk/

and the CSS is here

http://dnet.apc-compunet.co.uk/css/main.css

Thanks
k0r54

Fang
02-20-2005, 06:38 AM
It appears to be a rounding error.
Try re-sizing the browser, slowly, you will see the background image which shows through to the right of #login disappear then reappear.
You could give #login right:-1px; and add 1px to it's width.

k0r54
02-20-2005, 09:25 AM
the problem is it then puts it out on the other 3 browsers, firefox ect... ????

k0r54
02-20-2005, 11:37 AM
Any Ideas

Fang
02-20-2005, 11:53 AM
A quick fix would be to slice tilebottom.jpg, have the top half 100% width and
the bottom half 99% width. That way nothing 'appears' to the right of #login.

k0r54
02-20-2005, 01:56 PM
mmm,

Yeah but it wouldn't solve the problem just havin nufin behind it,

I think i have to redesign a little bit!

If you have any ideas or a good way to do this let me know

Thanks
k0r54

Fang
02-20-2005, 02:46 PM
Yeah but it wouldn't solve the problem just havin nufin behind it, It's a rounding error, depentent on the width of the browser.

k0r54
02-20-2005, 03:23 PM
how come though, when you float right, the problem doesn't happen

Sorry about all the q's

k0r54

Fang
02-20-2005, 04:41 PM
floated is floated as far as the parent element will allow, absolute is calculated from a reference point.
Try to avoid mixing:
units; relative and absolute
position; relative and absolute

k0r54
02-21-2005, 04:25 AM
Ok, i have done this and it only does it in IE so it fixes it

/* IE Hack */
* html #login {
right:-1px;
}

I dont know why this works,

Can some1 explain to me please ??

Thanks
Adam

Fang
02-21-2005, 10:00 AM
It is a rule that only IE applies, http://centricle.com/ref/css/filters/