color on only the text not the empty space in a td

I'm trying to get the background color to wrap around the text alone, not the empty spaces.

I now have:

<TD> Text <BR><BR>
Longer text that stretches out above text-background color...
</TD>

and css:

td {background-color: black; color: white}

The rest of the space I would like just to be transparant, but I can't find any variable for this...


尝试跨越如下所示将做你的工作.....

<TD> <span> Text <BR><BR> Longer text that stretches out above text-background color... 
 </span></TD> 

span {background-color: black; color: white} 

try display:inline; :

td {background-color: black; color: white; display:inline;}

在文本周围放置一个<span> ,并给出背景颜色。

链接地址: http://www.djcxy.com/p/15694.html

上一篇: 抵消html锚点以调整固定标题

下一篇: 仅在文本上显示颜色,而不在td中显示空白区域