如何使用CSS禁用链接?

时间:2019-07-17 12:27:06

标签: html css wordpress

我在wordpress页中具有以下链接。

此类是一个链接。是否可以仅使用CSS禁用链接?

<a class="select-slot__serviceStaffOrLocationButton___5GUjl"><i class="material-icons select-slot__serviceStaffOrLocationIcon___3WFzp">timelapse</i><span class="select-slot__serviceName___14MHL">Employee Assistance Line</span></a>

3 个答案:

答案 0 :(得分:1)

您可以执行以下操作:

.select-slot__serviceStaffOrLocationButton___5GUjl {
  pointer-events: none;
  color: black; (the color which is your normal text maybe?)
}

答案 1 :(得分:0)

使用pointer-event:none;

.select-slot__serviceStaffOrLocationButton___5GUjl{
  pointer-event:none;
}
<a class="select-slot__serviceStaffOrLocationButton___5GUjl"><i class="material-icons select-slot__serviceStaffOrLocationIcon___3WFzp">timelapse</i><span class="select-slot__serviceName___14MHL">Employee Assistance Line</span></a>

答案 2 :(得分:0)

.select-slot__serviceStaffOrLocationButton___5GUjl
{
pointer-events: none; 
}

将此添加到CSS。

如果要将链接显示为普通文本,请使用此按钮。

 .select-slot__serviceStaffOrLocationButton___5GUjl
{
pointer-events: none; 
cursor: default; 
text-decoration: none; 
color: black; 
}