text background

liunx

Guest
Hey all hope you're well . . .<br />
<br />
I'm hanging my head in shame . . . I just can't work this out, and I am sure it is something so so simple it is gonna hurt when I find out how to do it.<br />
<br />
I'm using tables to arrange my text on a page, doing a 100% length slim left orientated cell for the navigation, and a wider width cell to it's right. I have an image mapped gif for the navigation in the left cell. The problem is I wanna add stuff below it. More specifically a Mini-poll. But as my site has black text and white background color scheme I want the heading 'Mini-poll' to be white text on a BLACK background, but not so as it spans the entire cell, I only want it on the words. <br />
I can't use bgcolor in a <th> in a style sheet coz it's um below the head of the cell<br />
I'll attach the page but it's not finished!<br />
<br />
Please help ne1!<br />
<br />
<br />
dirtystim<!--content-->Hiya,<br />
There are several ways you can do this.<br />
First way and maybe the easiest, is you could create an image on a black background with your white text on it...OR... second, you can put your text inside a seperate table with a black background and specify your font white, however if you're going to do this, you will not be able to specify your table and cell background color attributes in your style tags as this will over-ride all other specified attributes. (in IE anyway). I hope this helps.<!--content-->Cool! Thanx Ian, I thought so.<br />
<br />
I think I'll knock up a little gif, then at least it'll have a little charisma about it . . .<br />
<br />
<br />
Cheers!<br />
<br />
dirtystim<!--content-->Why don't you just divide the cell, and specify a specific style for the element?<br />
<br />
Like<br />
<TD STYLE="background-color: #FFFFFF; color: #000000"><!--content-->Just put the style right on the text:<br />
<br />
<span style="background-color:#ffffff;color#000000">the text</span><br />
<br />
or better yet define the style with a class in the style sheet and just apply the class to the span<!--content-->Interesting<br />
The <span> tag. What is it for, actually?<br />
Just to apply style formats to text?<br />
Does it behave like a paragraph?<br />
Can it be used on other objects too, like images?<!--content-->The span tag does nothing by itself, it must contain some attributes. It applys whatever attributes are specified between the open span tag and closing span tag. <br />
<br />
Not sure if it is effective when used on other than text/block elements, but it might be. <br />
<br />
Regards,<br />
Kevin<!--content-->Span basically gets defined by its content will work anywhere a div can be used but it does not add a linfeed the way a div does so you can stick it anywhere without screwing up the formatting.<!--content-->
 
Back
Top