简体   繁体   English

鼠标悬停时增加标题文本的大小

[英]increase size of title text on mouse hover

I want increase title tag size on mouse hover which is in anchor tag. 我想在鼠标悬停时增加标题标签大小,这是锚标签。 so how can target to title. 那么如何定位到冠军。

<a href="#pop-up-form" rel="wp-video-lightbox" title="Nous contacter" class="a">kesar sisodiya</a>

The title text is handled by the browser and is not made available to us. title文本由浏览器处理,不向我们提供。 You could make your own title text handler with JavaScript, but I don't think that's a very good solution. 可以使用JavaScript创建自己的title文本处理程序,但我认为这不是一个非常好的解决方案。

You can't increase the size of title property. 您无法增加title属性的大小。

You can try using the tooltip provided by jQuery. 您可以尝试使用jQuery提供的工具提示。 jQuery Tooltip example jQuery Tooltip示例

You could use a div that displayed when you hover over your text. 您可以使用将鼠标悬停在文本上时显示的div。

<div class="custom_title_tag">This is the title</div>

then style it with css 然后用css设计它

a:hover .custom_title_tag {
    background:black;
    opacity: 1.0;
}

The first answer was pretty straightforward though. 第一个答案很简单。 But you could just position it relative to the link title you want to show. 但是你可以将它相对于你想要显示的链接标题定位。

check this, hope it helps you 检查一下,希望它对你有所帮助

a {
      color: #000;
      text-decoration: none;
    }


    a:hover {
      color: green;
      position: relative;
    }


    a[title]:hover:after {
      content: attr(title);
      padding: 4px 8px;
      color: #000;
      position: absolute;
      left: 0;
      top: 100%;
      white-space: nowrap;
      z-index: 20px;
      -moz-border-radius: 5px;
      -webkit-border-radius: 5px;
      border-radius: 5px;
      background:#ccc;

    }

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

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