如何从<u>标签中的<sub>删除下划线?

时间:2017-01-19 20:53:37

标签: html css

如何使用CSS删除<u>标记中包含的下标文本中的下划线?

这不起作用。

&#13;
&#13;
u sub {
  text-decoration: none;
}
&#13;
<u>The text should be underlined,<sub>but not the subscript</sub></u>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:7)

您可以将sub设置为display: inline-block;

u sub {
  display: inline-block;
}
<u>The text should be underlined,<sub>but not the subscript</sub></u>