Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts
May 20, 2020. Label:

CSS: How to Set Background Color to be the Same Width of Text

CSS: How to Set Background Color to be the Same Width of Text
It was when I needed to highlight a line of text that I stumble upon a simple knowledge of CSS on how to set background color to be the same width of text in a line. It's more a matter of taste rather than a necessity, since one can just set background color with the same width of the text container.

See also