I am using a Chrome plugin to apply custom stylesheet tweaks to someone else's website (i.e. I can't change the HTML).
I would like to stop underlining italic (<i>
) text inside an underline (<u>
) element, while retaining normal underlining for other parts inside the <u>
.
For example these are the kind of thing I'm after:
<u>Foo</u> --> Foo (underlined)
<u><i>Bar</i></u> --> Bar (not underlined)
<u>Foo <i>Bar</i></u> --> Foo (underlined) Bar (not underlined)
I tried:
u i {
text-decoration: none !important;
}
But found that changing the text-decoration for the <i>
makes no difference. The outer <u>
seems to be the one that determines the text-decoration.
Is there a way to do this?
I understand this might be a duplicate of Is there a CSS parent selector? but hoping someone might be able to come up with a clever workround for this specific case.