views:

49

answers:

4
<td valign="center" colspan="2">
        <a href="" class="table_desc" >
        <span class="desc_info_butt"></span>
        </a>
        text here
</td>


.desc_info_butt{
background:url(Description_Button.png) top left no-repeat;
height:16px;
width:16px;
display:block;
}

For some reason, the image and text appear on two different lines!~

+1  A: 

Try giving the span a float: left

at the moment, it's a block level element, forcing everything else into the next line.

By the way, I'd recommend putting a &nbsp; into the span so it gets displayed in all browsers.

Pekka
+1  A: 

Because you've set your span to display as a block-level element. Remove the display: block and that should fix it.

Matt Ball
Then he will lose the ability to set a fixed height.
Pekka
You're right. Assuming he wants to set a fixed height, he should be using `display: inline-block;`.
Matt Ball
+3  A: 

You need to change this:

display:block;

To this:

display:inline-block;

block behaves like any block element, pushing the next one below it. You either need to make it an inline-block, float it, or take away the block styling all-together.

Nick Craver
Caveat: `IE 6/7 accepts the value only on elements with a natural display: inline.` http://www.quirksmode.org/css/display.html (which is the case in this case so it should be fine)
Pekka
@Pekka, and older versions of Gecko don't support `inline-block`. `-moz-inline-box` is an acceptable substitute for *most* but **not all** cases. For IE 6/7 and "natural" `block` elements, `display: inline; zoom: 1;` triggers `hasLayout`, which for an `inline` element is exactly the same in IE as `inline-block`. So this *usually* suffices for `inline-block` on any element across browsers: `display: -moz-inline-box; display: inline-block; *display: inline; *zoom: 1;`
eyelidlessness
+1  A: 

display:block transforms the span in a block (equivalent to div) so that moves the next elements on a new line

rslite