Why does display: inline-block; remove an underline from a child element?
问题 Recently I answered a question and the OP wanted text-decoration: underline; for the entire text wrapped inside the a element, but not the one wrapped inside span , so it was something like this <a href="#"><span>Not Underline</span>Should Be Underlined</a> So simply giving span { text-decoration: none; } doesn't remove the underline for the text wrapped inside a span element But this does remove the underline span { text-decoration: none; display: inline-block; } So I made the span an inline