The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › limit background color to text only, not full width
applying a background-color to the first line of an address in a plain text paragraph; the first line is maybe 20% width but the color spans across the entire page;
using an in-line style like
John & Jane Johnson
using span and div produce same result
how do I limit the background color to just where the text is?
If you want to treat a section of text separately you have to be able to target it.
In this case, you need to wrap the required text in a span like this
Although I wouldn’t use inline styling but rather give the span a class and address it my CSS sheet.
thx Paulie_D! surprised I haven’t encountered this before :/