开发者

How to disable a HTML tag?

I want to disable a tag if it's already set -- e.g., disable a menu using disabled = "true" or something.

I can remove a tag completely using PHP; but I have already styled it and only want to disable开发者_JAVA百科 it. Is it possible?


Nope, there is no CSS-only way known to me to disable a link the way you describe.

The only thing that comes to mind is putting an additional, transparent element in front of the link, but that can't be achieved in pure CSS, either.

How about giving it a href='#' onclick='return false' when generating them in PHP?


you could also use the css property display:none;


you can try this

a.disabled_class_name{
    pointer-events: none;
    cursor: default;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜