1. <legend id='Qwm2m'><style id='Qwm2m'><dir id='Qwm2m'><q id='Qwm2m'></q></dir></style></legend>
        <tfoot id='Qwm2m'></tfoot>

        <small id='Qwm2m'></small><noframes id='Qwm2m'>

          <bdo id='Qwm2m'></bdo><ul id='Qwm2m'></ul>
        <i id='Qwm2m'><tr id='Qwm2m'><dt id='Qwm2m'><q id='Qwm2m'><span id='Qwm2m'><b id='Qwm2m'><form id='Qwm2m'><ins id='Qwm2m'></ins><ul id='Qwm2m'></ul><sub id='Qwm2m'></sub></form><legend id='Qwm2m'></legend><bdo id='Qwm2m'><pre id='Qwm2m'><center id='Qwm2m'></center></pre></bdo></b><th id='Qwm2m'></th></span></q></dt></tr></i><div id='Qwm2m'><tfoot id='Qwm2m'></tfoot><dl id='Qwm2m'><fieldset id='Qwm2m'></fieldset></dl></div>

        下划线&lt;a&gt;悬停时标记

        时间:2023-07-31

            <tfoot id='afW3w'></tfoot>

            • <bdo id='afW3w'></bdo><ul id='afW3w'></ul>
                <tbody id='afW3w'></tbody>

                  <legend id='afW3w'><style id='afW3w'><dir id='afW3w'><q id='afW3w'></q></dir></style></legend>
                  <i id='afW3w'><tr id='afW3w'><dt id='afW3w'><q id='afW3w'><span id='afW3w'><b id='afW3w'><form id='afW3w'><ins id='afW3w'></ins><ul id='afW3w'></ul><sub id='afW3w'></sub></form><legend id='afW3w'></legend><bdo id='afW3w'><pre id='afW3w'><center id='afW3w'></center></pre></bdo></b><th id='afW3w'></th></span></q></dt></tr></i><div id='afW3w'><tfoot id='afW3w'></tfoot><dl id='afW3w'><fieldset id='afW3w'></fieldset></dl></div>

                  <small id='afW3w'></small><noframes id='afW3w'>

                • 本文介绍了下划线&lt;a&gt;悬停时标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我希望我的 <a> 标签在悬停时带有下划线.我有以下代码,但它不起作用.

                  <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 过渡//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="服务器"><标题></标题><style type="text/css">a.hover:hover {文本装饰:下划线;}</风格></头><身体><form id="form1" runat="server">

                  <a class="hover" style=" text-decoration:none; color:red" href="">站点地图</a></div></表格></身体></html>

                  这个:

                  a:hover {text-decoration: underline;}<a style=" text-decoration:none; color:red" href="">站点地图</a>

                  也不行.

                  我该怎么办?有什么问题?

                  解决方案

                  style属性更多比任何选择器都特定,所以它总是在级联中最后应用(可怕的 !important 规则无法承受).将 CSS 移至样式表.

                  a.hover {红色;文字装饰:无;}a.hover:悬停{文字装饰:下划线;}

                  (我还建议为该类命名更具语义化的名称).

                  I want my <a> tag gets underlined when hovered. I have the following code, but it doesn't work.

                  <%@ 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></title>
                      <style type="text/css">
                  
                       a.hover:hover {text-decoration: underline;}
                       </style>
                  </head>
                  <body>
                      <form id="form1" runat="server">
                      <div>
                      <a class="hover" style=" text-decoration:none; color:red" href="">Site Map</a>
                  
                      </div>
                      </form>
                  </body>
                  </html>
                  

                  This:

                  a:hover {text-decoration: underline;}
                  <a  style=" text-decoration:none; color:red" href="">Site Map</a>
                  

                  doesn't work either.

                  What should I do? What is the problem?

                  解决方案

                  The style attribute is more specific than any selector, so it will always be applied last in the cascade (horrible !important rules not withstanding). Move the CSS to the stylesheet.

                  a.hover {
                      color: red;
                      text-decoration: none;
                  }
                  
                  a.hover:hover {
                      text-decoration: underline;
                  }
                  

                  (I also suggest a more semantic name for the class).

                  这篇关于下划线&lt;a&gt;悬停时标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 HTML 中双删除线? 下一篇:在 Tumblr 中定义每个标签的样式

                  相关文章

                    <legend id='F1j1J'><style id='F1j1J'><dir id='F1j1J'><q id='F1j1J'></q></dir></style></legend>

                      <bdo id='F1j1J'></bdo><ul id='F1j1J'></ul>
                  1. <tfoot id='F1j1J'></tfoot>
                    1. <small id='F1j1J'></small><noframes id='F1j1J'>

                      <i id='F1j1J'><tr id='F1j1J'><dt id='F1j1J'><q id='F1j1J'><span id='F1j1J'><b id='F1j1J'><form id='F1j1J'><ins id='F1j1J'></ins><ul id='F1j1J'></ul><sub id='F1j1J'></sub></form><legend id='F1j1J'></legend><bdo id='F1j1J'><pre id='F1j1J'><center id='F1j1J'></center></pre></bdo></b><th id='F1j1J'></th></span></q></dt></tr></i><div id='F1j1J'><tfoot id='F1j1J'></tfoot><dl id='F1j1J'><fieldset id='F1j1J'></fieldset></dl></div>