JDillon522
JDillon522

Reputation: 19666

CSS - make text decoration: underline extend all the way to :before elements

I'm using an Icomoon icon font to add an icon on the :before element of an <a>. It works great but the text-decoration: underline only covers the icon, and then the text in the anchor. There is a blank, not underlined section between the two.

How can I make the underline extend across both the <a> tag and its pseudo elements?

Upvotes: 0

Views: 974

Answers (1)

Verhaeren
Verhaeren

Reputation: 1661

Rather than text-decoration: underline you could work around that by giving to the anchor a couple of properties like display: inline-block plus a width and finally a border-bottom. Just a thought

Upvotes: 2

Related Questions