Posted by Jukka K. Korpela on 04/09/07 11:38
Scripsit Desmond:
> Is it possible to [s]et the bac[k]ground colour of text without setting
> the
> entire background.
It depends on what you mean by background of text. You can set the
background for an _element_, including pseudo-elements, not for text as
such.
> I have menu items and the current item is set at #777777 but setting
> the background
> to background: #99E7E7; sets the whole of the menu not just the text.
> as in .....
>
> #tabnav li
> { margin: 0;
> padding: 0;
> display:list-item;
> list-style-type: none;
> /* background: #99E7E7; */
> color: #777777;
> }
Why have you put the most important declaration in a comment?
Anyway, <li> elements occupy the available width by default, and setting the
background sets it for the element, not just for the text in it. So
apparently you would like to make element's width smaller or to set
background for an inner element that has a smaller width.
What are you really trying to accomplish? This sounds like a navigational
menu. Perhaps you should set some suitable width (say width: 5em) for all
items in the menu. Or perhaps you should post the URL.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
[Back to original message]
|