改变IE中的下划线颜色

时间:2015-12-23 15:17:57

标签: html css

我有文本编辑器,用户可以玩。在那我有一个IE下划线颜色问题。代码

test <font color="#4ab948"><u>paragraph</u></font>

将为文本和下划线应用颜色。如果用户首先选择下划线然后选择颜色,则生成的代码如下所示,不会为下划线应用颜色:(

test <u><font color="#4ab948">paragraph</font></u>

运气好吗?

3 个答案:

答案 0 :(得分:0)

private void setUpJButton() { logInButton.setSize(50, 50); logInButton.addActionListener(acLs); logOutButton.setSize(50, 50); logOutButton.addActionListener(acLs); } 已暂时弃用了一段时间。相反,您应该将font与应用于span的样式属性结合使用。例如:

&#13;
&#13;
span
&#13;
&#13;
&#13;

答案 1 :(得分:0)

如果要绝对控制text-decoration元素上的u属性,请用伪元素覆盖它。

&#13;
&#13;
u {
  text-decoration: none;
  position: relative;
  color: red;
}
u:after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 1px;
  background: green;
  margin-top: -2px;
}
&#13;
<u>paragraph</u>
&#13;
&#13;
&#13;

答案 2 :(得分:0)

你可以提出两种方法

使用border-bottom 作为

span {
color: red;
text-decoration: none;
border-bottom: 1px solid green;
}

OR

使用跨度方法作为

a {
  color: green;
  text-decoration: underline;
}
span {
  color: red;
  text-decoration: none;
}