views:

45

answers:

2

I'm using a UL to display the options for data visualizations on a site. The items are displayed inline and retrieve the image from a sprite png. This works fine in FireFox 3x, but in Chrome and Safari, the first item disappears. If I replace the sprites with the individual images, all of the list items display properly.

Here's the CSS:

ul {margin:5px 0 0;padding:10px 6px 6px;}  
li {display:inline;padding:cursor:pointer;padding:11px 2px 2px 5px;}  
li.active {border:1px solid #ccc;background-color:#fff;}  
li div {display:inline;padding:6px 10px;}  
.bttns {background-image:url('../sprites.png');background-repeat:no-repeat;}  
.bttns-info {background-position: 0 -726px;height:16px;width:16px;}  
.bttns-table {background-position: 0 -330px;height:16px;width:16px;}  
.bttns-chart {background-position: 0 0;height:16px;width:16px;}

And the HTML:
<ul>
<li class="active ui-corner-all"><div class="bttns bttns-info"></div></li>
<li><div class="bttns bttns-table"></div></li>
<li><div class="bttns bttns-chart"></div></li>
</ul>

It's loosely based on the CSS from the jQuery UI library. And it's nested in a div using the ui-accordion-header class. None of the tweaks I've tried have made a difference.

Am I missing something? It's pulling down the sprites; the positions are correct; the other items display properly when the active class is applied to them. It's just odd.

Thanks, soren

A: 

What is the CSS, if any, for the class 'ui-corner-all'? I think your answer lies there.

mkoistinen
The padding:cursor is just a typo here. And when I reorder the items, the bttns-info image appears, but the new first item disappears. So bttns-table is no longer visible.
soren
Also, ui-corner-all is a class from the jQuery UI library that is just this: -moz-border-radius: 4px; -webkit-border-radius: 4px;
soren
What if you remove it?
mkoistinen
Same thing happens - the first list item is missing.
soren
A: 

Turns out it was the display:inline property on the div in the li that interferes with the display in Chrome and Safari. Once I removed that, the first item displayed properly.

soren