如何更改锚标记内title属性的样式? [英] How to change the style of the title attribute inside an anchor tag?

查看:96
本文介绍了如何更改锚标记内title属性的样式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

示例:

<a href="example.com" title="My site"> Link </a>

如何更改浏览器中"title"属性的显示方式?默认情况下,它只有黄色背景和小字体.我想将其放大并更改背景颜色.

How do I change the presentation of the "title" attribute in the browser?. By default, it just has yellow background and small font. I would like to make it bigger and change the background color.

是否有样式标题属性的CSS方法?

Is there a CSS way to style the title attribute?

推荐答案

以下是如何执行此操作的示例:

Here is an example of how to do it:

a.tip {
    border-bottom: 1px dashed;
    text-decoration: none
}
a.tip:hover {
    cursor: help;
    position: relative
}
a.tip span {
    display: none
}
a.tip:hover span {
    border: #c0c0c0 1px dotted;
    padding: 5px 20px 5px 5px;
    display: block;
    z-index: 100;
    background: url(../images/status-info.png) #f0f0f0 no-repeat 100% 5%;
    left: 0px;
    margin: 10px;
    width: 250px;
    position: absolute;
    top: 10px;
    text-decoration: none
}

<a href="#" class="tip">Link<span>This is the CSS tooltip showing up when you mouse over the link</span></a>

这篇关于如何更改锚标记内title属性的样式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆