Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.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
Html 是否可以使用href链接显示无? 任何文本或图像_Html_Css_Display - Fatal编程技术网

Html 是否可以使用href链接显示无? 任何文本或图像

Html 是否可以使用href链接显示无? 任何文本或图像,html,css,display,Html,Css,Display,我想使用href的值添加display none 例如:我只想将display:none添加到重定向到example.html的所有锚定标记中。所有其他锚定标记应仍然可见 换句话说,我只想隐藏指向example.html的链接 这可能吗?您可以使用以下解决方案,使用: a[href=“example.html”]{ 显示:无; } 任何文本或图像 堆栈溢出是的,这是可能的。通过以下方式进行: a[href=“example.html”{显示:无!重要;} 这将隐藏所有具有“example.h

我想使用href的值添加display none

例如:我只想将
display:none
添加到重定向到
example.html
的所有锚定标记中。所有其他锚定标记应仍然可见

换句话说,我只想隐藏指向
example.html
的链接


这可能吗?

您可以使用以下解决方案,使用:

a[href=“example.html”]{
显示:无;
}
任何文本或图像

堆栈溢出
是的,这是可能的。通过以下方式进行:

a[href=“example.html”{显示:无!重要;}
这将隐藏所有具有“example.html”值的锚定标记。

您可以使用来定位所需的锚定标记

[href="'example.html'"]{display: none;}

你为什么要使用
!重要信息
?有时可能会有一个带有标记且具有css display:block的类,如果没有iImportant,它将无法工作
[href="'example.html'"]{display: none;}
[href="example.html"] {
  display: none;
}