Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如果有使用css的href,则在锚点中显示下划线_Css - Fatal编程技术网

如果有使用css的href,则在锚点中显示下划线

如果有使用css的href,则在锚点中显示下划线,css,Css,如果有使用css的href,则在锚点中显示下划线 <a class="myLink" >click here</a> 悬停时不应显示下划线 我应该在myLink css中写些什么,这两者都适用 a { text-decoration: none; } a[href] { text-decoration: underline; } 使用 a{ 文字装饰:无; } a[href]{ 文字装饰:下划线; } 不带href的锚定创建类似..

如果有使用css的href,则在锚点中显示下划线

<a class="myLink" >click here</a>

悬停时不应显示下划线

我应该在myLink css中写些什么,这两者都适用

a
{
    text-decoration: none;
}    

a[href]
{
    text-decoration: underline;
}
使用

a{
文字装饰:无;
}
a[href]{
文字装饰:下划线;
}


不带href的锚定
创建类似..的css

<Style>
    a {
       text-decoration: none;
        }
     a[href] {
         text-decoration: underline;
       }
   </Style>

a{
文字装饰:无;
}
a[href]{
文字装饰:下划线;
}
请记住,这将影响网页上的整个锚定标记。您将提供特定的id以避免此冲突


查看此代码以了解更多信息。

如果没有href,则需要下划线,如果有href,则不显示下划线?此外,如果没有href,则不显示下划线…这不是链接。他正在用自己的想法做一些事情。我们不想知道它是什么?如果可能,请回答他的问题。。
<Style>
    a {
       text-decoration: none;
        }
     a[href] {
         text-decoration: underline;
       }
   </Style>