答案 0 :(得分:8)
简单回答:否
使用CSS无法关闭它们。它们取决于浏览器,并且不属于任何CSS规范,即您无法设置它们,隐藏它们,任何东西。
虽然你可以通过Javascript摆脱它们:
var elements = document.getElementsByTagName('a');
for (var i = 0, len = elements.length; i < len; i++)
{
elements[i].removeAttribute('title');
}
答案 1 :(得分:2)
它们实际上是title
标签,您无法使用css删除它们(您可以使用javascript)但我猜它们是有原因的。
答案 2 :(得分:1)
从我所看到的网站中,当您将鼠标悬停在侧边栏链接上时,您会收到工具提示,因为它们各自都有title
属性。
我认为CSS中没有任何东西可以防止这些出现。在悬停的工具提示中显示这些是浏览器做出的决定,与HTML的呈现分开。
您可以做的最好的事情是use JavaScript to remove the title
attribute。
答案 3 :(得分:0)
您可以使用 CSS 隐藏任何替代文字的图片,例如alt =“LinkedIn”
[alt="LinkedIn"] {
display: none !important;
}
您还可以隐藏带有标题的图片,例如title =“Company logo”
[title="Company logo"] {
display: none !important;
}
答案 4 :(得分:0)
Dear stackoverflow members,
I wanted to remove the img alt attribute, to remove the alt thing, with css, without changing html php, or adding java elements.
I wanted simply this box (border) around the image that is appearring to be removed. I could not find anywhere this simple solution! So i post it here! I hoep will help someone! I include a screenshot.
I made height and width to be exact with the picture, no more, no less. Also, check that font-size attribute element was set to 0.
That is (dependign on other set attributes, you may also need to adjust them, in order this "box" be adjusted to the exact size of your image:
$(element).stop(false,true);
答案 5 :(得分:0)
您可以使用如下所示的CSS:
pointer-events: none;