mdo / wtf-html-css

Common reasons your HTML and CSS may be fucked.
http://wtfhtmlcss.com
MIT License
1.41k stars 85 forks source link

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

Open hoodwink73 opened 10 years ago

hoodwink73 commented 10 years ago

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

zlatanvasovic commented 10 years ago

Did you try to fix it with !important?

1ace commented 10 years ago

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.

hoodwink73 commented 10 years ago

@ZDroid nope !important doesn't work.

zlatanvasovic commented 10 years ago

:(

2014-03-25 5:30 GMT+01:00 Arijit Bhattacharya notifications@github.com:

@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