I ran into a situation where I have a link that is set as a display:block
. I'm trying to fill the background-color property with a color, but only behind the text; instead, it's filling the entire background of that row, which is logical, but not what I want. How can I fill only the background of the text without being an inline element? Or is this not possible?
HTML:
<a href ="#">mylink</a>
CSS:
a {
display:block;
background-color:blue;
}