猿问

如何更改锚标记内的title属性的样式?

如何更改锚标记内的title属性的样式?

例子:

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

如何在浏览器中更改“title”属性的表示方式?默认情况下,它只有黄色背景和小字体。我想把它变大,改变背景色。

有CSS方式来样式标题属性吗?


ABOUTYOU
浏览 739回答 3
3回答

千巷猫影

下面是如何做到这一点的一个例子:a.tip {&nbsp; &nbsp; border-bottom: 1px dashed;&nbsp; &nbsp; text-decoration: none}a.tip:hover {&nbsp; &nbsp; cursor: help;&nbsp; &nbsp; position: relative}a.tip span {&nbsp; &nbsp; display: none}a.tip:hover span {&nbsp; &nbsp; border: #c0c0c0 1px dotted;&nbsp; &nbsp; padding: 5px 20px 5px 5px;&nbsp; &nbsp; display: block;&nbsp; &nbsp; z-index: 100;&nbsp; &nbsp; background: url(../images/status-info.png) #f0f0f0 no-repeat 100% 5%;&nbsp; &nbsp; left: 0px;&nbsp; &nbsp; margin: 10px;&nbsp; &nbsp; width: 250px;&nbsp; &nbsp; position: absolute;&nbsp; &nbsp; top: 10px;&nbsp; &nbsp; text-decoration: none}<a href="#" class="tip">Link<span>This is the CSS tooltip showing up when you mouse over the link</span></a>
随时随地看视频慕课网APP
我要回答