Html 下划线<;a>;悬停时标记
我想要我的Html 下划线<;a>;悬停时标记,html,css,tags,Html,Css,Tags,我想要我的 这: a:hover{text装饰:下划线;} 也不行 我该怎么办?问题出在哪里?样式属性比任何选择器都重要,因此它总是在级联中最后应用(可怕的!重要的规则无法承受)。将CSS移动到样式表中 a.hover { color: red; text-decoration: none; } a.hover:hover { text-decoration: underline; } (我还建议为该类使用更具语义的名称)。内联样式将覆盖页面上的样式 删除内联样式
这:
a:hover{text装饰:下划线;}
也不行
我该怎么办?问题出在哪里?样式属性比任何选择器都重要,因此它总是在级联中最后应用(可怕的
!重要的规则无法承受)。将CSS移动到样式表中
a.hover {
color: red;
text-decoration: none;
}
a.hover:hover {
text-decoration: underline;
}
(我还建议为该类使用更具语义的名称)。内联样式将覆盖页面上的样式
删除内联样式并使用以下选项:
<style type="text/css">
a {text-decoration: none;}
a:hover {text-decoration: underline;}
</style>
a{文本装饰:无;}
a:悬停{文本装饰:下划线;}
还建议您不要使用
,而是使用外部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 runat="server">
<title></title>
<style type="text/css">
a.hover
{
text-decoration: none;
color:red
}
a.hover:hover
{
text-decoration: underline;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<a class="hover" href="">Site Map</a>
</div>
</form>
</body>
</html>
a、 盘旋
{
文字装饰:无;
颜色:红色
}
a、 悬停
{
文字装饰:下划线;
}
这对您很有用
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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 runat="server">
<title>ABC</title>
<style type="text/css">
a.hover {text-decoration: none; color: red;}
a.hover:hover {text-decoration: underline;}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<a class="hover" href="">Site Map</a>
</div>
</form>
</body>
</html>
基础知识
a、 悬停{文本装饰:无;颜色:红色;}
a、 悬停:悬停{文本装饰:下划线;}
阅读更多有关css规范的信息。我认为您应该编写如下代码:
()
a{文本装饰:无;颜色:红色}
a:悬停{文本装饰:下划线;}
这可能会有帮助
a.hover:link {text-decoration: none;}
a.hover:hover {text-decoration: underline;}
默认行为是始终在所有链接下加下划线。不,不会<代码>悬停下划线
不是文本装饰
属性的有效值。
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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 runat="server">
<title>ABC</title>
<style type="text/css">
a.hover {text-decoration: none; color: red;}
a.hover:hover {text-decoration: underline;}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<a class="hover" href="">Site Map</a>
</div>
</form>
</body>
</html>
<!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 runat="server">
<title></title>
<style type="text/css">
a {text-decoration: none; color:red}
a:hover {text-decoration: underline;}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<a class="hover" href="">Site Map</a>
</div>
</form>
</body>
</html>
a.hover:link {text-decoration: none;}
a.hover:hover {text-decoration: underline;}