wtf-html-css icon indicating copy to clipboard operation
wtf-html-css copied to clipboard

Can't have a non-underlined pseudoelement for an underlined element

Open hoodwink73 opened this issue 11 years ago • 4 comments

I stumbled into a situation where

text-decoration: none;

applied to ::after didn't have any effect if the parent had

text-decoration: underline;

But if we apply overline to just the pseudoelement, it works.

I am aware that nested children within a parent having an underline behaves the same way.

Here is the codepen http://codepen.io/hoodwink73/pen/HzeKd

hoodwink73 avatar Mar 24 '14 08:03 hoodwink73

Did you try to fix it with !important?

zlatanvasovic avatar Mar 24 '14 21:03 zlatanvasovic

I am aware that nested children within a parent having an underline behaves the same way.

::before and ::after are nested children: (MDN)

::before creates a pseudo-element that is the first child of the element matched.

But the tip is still valid, I had trouble with it too until I learned that.

1ace avatar Mar 24 '14 22:03 1ace

@ZDroid nope !important doesn't work.

hoodwink73 avatar Mar 25 '14 04:03 hoodwink73

:(

2014-03-25 5:30 GMT+01:00 Arijit Bhattacharya [email protected]:

@ZDroid https://github.com/ZDroid nope !important doesn't work.

— Reply to this email directly or view it on GitHubhttps://github.com/mdo/wtf-html-css/issues/5#issuecomment-38530036 .

Zlatan Vasović - ZDroid

zlatanvasovic avatar Mar 25 '14 11:03 zlatanvasovic