Posted by Ben C on 04/09/07 12:23
On 2007-04-09, Desmond <otuatail@aol.com> wrote:
> Is it possible to det the bacground colour of text without setting the
> entire background.
> 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;
> }
That's because li is a block box (well display: list-item, but similar
to a block box). It sounds like you want an inline-box background.
Try putting the text you want the background colour behind in a <span>
element, and adding
#tabnav li span { background: #99E7E7; }
[Back to original message]
|