最近做东西发现如果对某段文字添加下划虚线,在IE和firefox中是有问题的。现在提供一段css解决该问题。 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<style type="text/css">
<!--
.word {
font-family: "宋体";/*字体*/
color: #000000;/*字体颜色*/
text-decoration: none;
border-top-width: 1px;/*这几个1PX为虚线粗线,单产像素*/
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: none;
border-right-style: none;
border-bottom-style: dashed;
border-left-style: none;
border-top-color: #00FF00;/*这些值为虚线颜色*/
border-right-color: #00FF00;
border-bottom-color: #00FF00;
border-left-color: #00FF00;
}
-->
</style>
<body>
<span class="word">asdfasdf</span>
</body>
</html>