简体   繁体   English

HTML标题属性是一个toolip吗?

[英]Is html title attribute a toolip?

I have question to know the truth. 我有疑问要知道真相。 can some one tell me is HTML title attribute a tool tip. 有人可以告诉我HTML title属性是一种工具提示。 Someone told me it is not a tooltip. 有人告诉我这不是工具提示。 Can anybody describe what is a tool tip? 谁能描述什么是工具提示? and HTML title is it or not? 和HTML标题是吗? I need the truth pleas. 我需要真相拜托。

It is "Advisory information for the element" according to the specification . 根据规范,它是“元素的建议信息”。

Some browsers render it as a tooltip when you hover the element. 当您将元素悬停时,某些浏览器会将其呈现为工具提示。

Obviously a screen reader would not, it reads it out. 显然,屏幕阅读器不会,它会将其读出。

A touch screen browser would not, it doesn't support a hover state. 触摸屏浏览器不会,它不支持悬停状态。

Html title attribute is not a tool tip. HTML title属性不是工具提示。 But browsers can display it as a tooltip. 但是浏览器可以将其显示为工具提示。

The problem with this is that you no longer control what your website shows. 问题在于您不再控制网站显示的内容。 You will depend on whether the browser wants to show it or not. 您将取决于浏览器是否要显示它。 A tooltip is programmed so you can control the operation, and you can change it, add events, etc ... 对工具提示进行了编程,因此您可以控制操作,也可以对其进行更改,添加事件等...

https://www.w3schools.com/tags/att_title.asp https://www.w3schools.com/tags/att_title.asp

"The title attribute is part of the Global Attributes, and can be used on any HTML element." “标题属性是全局属性的一部分,可以在任何HTML元素上使用。”

It is simply an attribute, and the value of this attribute is being shown by most browsers when hovering over the element looking like a tool tip. 它只是一个属性,当悬停在看起来像工具提示的元素上时,大多数浏览器都会显示该属性的值。

In my opinion, it actually is a tooltip, since the value of the attribute is shown when the user hovers his mouse over the element. 在我看来,这实际上是一个工具提示,因为当用户将鼠标悬停在元素上时会显示属性的值。 But the styling and even if the value is being shown is up to the browser, and you have no control over it. 但是样式,即使显示的值也取决于浏览器,并且您无法控制它。

It just depends on what is a tooltip for you personally :) Usually, "web people" refer to tooltips as popup content when hovering over an element. 它仅取决于您个人的工具提示是什么:)通常,“网络人物”将鼠标悬停在元素上时,会将其作为弹出内容。 Usually, these tooltips are being shown using JavaScript or vanilly CSS. 通常,这些工具提示是使用JavaScript或Vanilly CSS显示的。 https://www.w3schools.com/howto/howto_css_tooltip.asp https://www.w3schools.com/howto/howto_css_tooltip.asp

My 2 cents - but I think it's really up to one personally whether you think of it as a tooltip. 我的2美分-但我认为,是否将其视为工具提示取决于个人。

Html title attribute is not tool-tip but on hover of the element we can see the title the element HTML标题属性不是工具提示,而是在元素悬停时可以看到元素的标题

For Eg: 例如:

ABCD INFO ABCD信息

so we will get output as 所以我们将获得输出为

enter image description here 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM