LJ 0

@this site i'm working on, theres a div that is posiitoned right in every other browser except IE.

Heres the CSS:

header#main #latest-news { background:  url(../images/latest-news-bg.png) no-repeat; float: right; height: 73px; margin: -78px -16px 0 0; width: 294px; }
header#main #latest-news p { font: 14px/1.2em Arial; padding: 10px; }

2 answers

Ktash 1851

Getting rid of the negative margin on it, and instead putting before the other elements should let it float to the right with no issues in any browser. Didn't get a chance to test it, but that looks like it'll be the issue.

Answered over 8 years ago by Ktash

Why use float for this if it's going to be sitting top right everytime? You could handle this with absolute positioning and pin it on it's own z-index making sure it wouldn't have to worry about other elements interacting with it ever. Your CSS would be more like this:

header#main #latest-news { background:  url(../images/latest-news-bg.png) no-repeat; position:absolute; right:0px; top:0px;height: 73px; margin: 0 0 0 0; width: 294px; }
Answered over 8 years ago by Peter Jaegersen