设置超链接文本修饰
1、演示效果
2、编写代码
超链接文本修饰#a1 {
text-decoration: none;
}
#a2 {
text-decoration: underline;
}
#a3 {
text-decoration: overline;
}
#a4 {
text-decoration: line-through;
}
#a5 {
text-decoration: blink;
}
#a6 {
text-decoration: underline overline;
}
li {
line-height: 30px;
}
var a5 = document.getElementById("a5");
setInterval('blinkObj(a5)', 500);
function blinkObj(obj) {
obj.style.visibility = obj.style.visibility == "hidden" ? "visible" : "hidden";
}
3、代码说明
第五个超链接,设置text-decoration为blink,其实没有闪烁效果,而是通过js来实现闪烁效果的。
一般情况下,超链接有下划线比较好。除非菜单项或按钮,用户清楚那是超链接,那时去掉下划线也是可以的。
本文分享 CSDN - howard2005。
如有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。