官术网_书友最值得收藏!

Simple custom tooltips

Browsers automatically create tooltips when you include the title attribute on your HTML element. Titles are usually used on links and images, but they can be added to nearly every type of HTML element. When your site visitors hover their mouse cursor over an element with a title attribute or move focus to the item by tabbing to it using the keyboard, the tooltip will appear—usually as a small yellow box that appears to be floating over the page.

Tooltips are a great way to add a little additional information to your page. Screen reader software reads out tooltip text for site visitors with disabilities who are using assistive technology, making them useful for enhancing accessibility. Furthermore, the title attributes on images and links can help search engines index your content more effectively.

I hope I've convinced you that the title attributes are great for enhancing both the usability and the accessibility of your site. The only problem with tooltips is that they can't be customized in any way. Each browser has its own style of tooltip and that style is not accessible via CSS. This is fine, but sometimes, it's nice to have more control over the appearance of tooltips.

主站蜘蛛池模板: 长汀县| 布拖县| 五河县| 盐边县| 肇州县| 彝良县| 富锦市| 南江县| 方正县| 南充市| 抚顺市| 新沂市| 京山县| 华亭县| 高邮市| 东方市| 襄垣县| 唐山市| 淄博市| 桃江县| 灵川县| 遂川县| 西乌珠穆沁旗| 民勤县| 庄河市| 镶黄旗| 甘孜县| 镇雄县| 南阳市| 肇东市| 弥勒县| 安义县| 甘泉县| 襄樊市| 耿马| 牟定县| 江西省| 吴旗县| 安达市| 仙桃市| 甘肃省|