Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there a way to make title= attribute work on Chrome?

<span title="Hover text">Hello World</span>

In Firefox, that will display a tooltip with "Hover text" but in Chrome, you get nothing. Any way to fix this with HTML/CSS or is another scripting language required?

like image 357
zeroality Avatar asked Apr 30 '12 22:04

zeroality


People also ask

Which browser support the title attribute?

Supported Browsers: The browser supported by title attribute are listed below: Chrome. Edge 12.

Is title attribute good for SEO?

Optimizing your alt and title attributes is also a benefit for user experience, which in turn, enhances your search engine ranking. Because Google can't actually “see” an image, keywords in the alt text help search crawlers scan a page and understand the purpose of those images.

Why title is not displayed in HTML?

Where do you expect title to be shown? Title is what usually is displayed in the tab bar of your browser, or as text in your window switcher in your operating system. It does not show up inside your webpage. Your markup seems to be correct, just look for the title in the browser window.

How do title attributes work?

The title attribute specifies extra information about an element. The information is most often shown as a tooltip text when the mouse moves over the element. The title attribute can be used on any HTML element (it will validate on any HTML element. However, it is not necessarily useful).


2 Answers

title="hover text" is the way chrome works. Are you sure you don't have something else (maybe a div with no content) overtop of the span text?

like image 91
gcochard Avatar answered Sep 17 '22 20:09

gcochard


It works for me with only title.

You should use both alt="Hover text" and title="Hover text"

like image 34
Sully Avatar answered Sep 18 '22 20:09

Sully