Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies

Object shifts itself into the item that follows it next

As if the item was floated right, but its not

1:50 am on Jan 5, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 12, 2005
votes: 0

I'm using a modified version of a AJAX CSS Star Rating Script, and I'm having a little bit of a problem with it's style.

Right now, the script wants to "take over" part of the next item, which right now happens to be my horizontal line. It embeds itself into that.

If a DIV followed next with a character, the stars would show to the right. If the DIV was empty, it would "take over" part of the next item.

So far this only seems to happen in IE6.

Any ideas?


<ul class="sr">
<li id="cr" style="width:25px">Current Rating: X</li>
<li><a href="#" onclick="return rate(1)" class="s1" title="This article is awful!">1</a></li>
<li><a href="#" onclick="return rate(2)" class="s2" title="This article is bad.">2</a></li>
<li><a href="#" onclick="return rate(3)" class="s3" title="This article is okay.">3</a></li>
<li><a href="#" onclick="return rate(4)" class="s4" title="This article is good.">4</a></li>
<li><a href="#" onclick="return rate(5)" class="s5" title="This article is great!">5</a></li>
<hr />

The CSS:

.sr{list-style:none;margin:0;padding:0;width:125px;height:25px;position:relative;background:url(/img/star.png) top left;cursor:pointer}
.sr li{padding:0;margin:0;float:left}
.sr a{display:block;width:25px;height:25px;text-indent:-999px;overflow:hidden;z-index:3;position:absolute;padding:0}
.sr a:hover{background:url(/img/star.png) left bottom;z-index:2;left:0}
#cr{background:url(/img/star.png) left center;position:absolute;height:25px;display:block;text-indent:-999px;z-index:1}
.s3{left: 50px}
.s5:hover{width: 125px}

11:24 am on Jan 5, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member suzyuk is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Oct 1, 2002
votes: 0

Jeremy that sample of code is working fine in IE6, there is no shifting

I can only assume it's some form of clearance/positioning problem due to something else on your page, likely what comes before the script rather than after it, do the stars follow a floated element?

try wrapping the whole ul (star script) in a div and set it [div] to be 100% wide, I wonder if trying to invoke natural clearance might help

IE6 (&7) does have some some problems with absolute positioning when the immediate parent is not the containing block (in this case the <a> element's containing block for positioning should be the <ul> and not the parent <li> so it could be that) however this is complete guesswork as your code is not displaying what you describe

if the above is no help, can you get us a working sample using the minimum of your layout code?


[edited by: SuzyUK at 11:28 am (utc) on Jan. 5, 2007]


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members