If you want to avoid setting the explicit width so that you can style the background according to the actual length of the text, you can do the following:
Wrap your link:
<p>To stay up to date <span><a href="#">Follow Us</a></span></p>
Please note that I added the <span>
via the link.
Create your wrapper using CSS:
span { display: inline-block; width: 100%; }
Setting the width to 100% causes the wrapper to span the entire string. Saving the <a>
tag for a link attached to an inline block allows you to indent and have a background effect if it does not expand to fit the width of the container 100%.
Forked JSFiddle: http://jsfiddle.net/Cm9kZ/
source share