是否可以设置标题的样式? (和CSS或js?) [英] Is it possible to style a title? (and with CSS or js?)

查看:270
本文介绍了是否可以设置标题的样式? (和CSS或js?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以设计标题

 < a href =#title =这是一个标题> Hello< / a> 

造型问题有两个方面:




  • 文本格式 / encoding(我猜是可能的,因为它在问题*中)。

  • Tooltip样式,你能让它更大吗?其他颜色?


另一个问题是你如何指向标题 p>


  • CSS

  • jQuery



提前感谢!



<

*通过文本格式/编码方式:



解决方案

您可以通过HTML实体强制在文本中换行。大多数浏览器,这些天支持这一点。这是您可以对浏览器的原生工具提示显示进行的唯一更改。

 < a href =real_linktitle =check&#13;&#10; this&#13;&#10; out> foo bar< / a> 

请参阅上述示例在网页上。



正如其他人所指出的,存在大量用于各种JS库的插件,用于制作自定义HTML工具提示,是样式。这里是 Google搜索的热门搜索jquery tooltip plugin ,检查10个这样的插件。


I was wondering if it was possible to style a title:

<a href="#" title="This is a title">Hello</a>

The styling question has two aspects:

  • Text formatting / encoding (Which I guess is possible SO does it in questions*).
  • The Tooltip styling, can you make it bigger? other colors? etc.

And the other issue I have is how do you "point" to title?

  • From CSS
  • From Javascript / jQuery

Thanks in advance!


*What I ment by text formatting / encoding:

解决方案

You can put newlines in your title attribute via HTML entities to force a line break in the text. Most browsers these days support this. This is the only change you can make to the native tooltip display of the browser.

<a href="real_link" title="check&#13;&#10;this&#13;&#10;out">foo bar</a>

See the above example on a web page.

As others have pointed out, there exist a large number of plugins for various JS libraries for making custom HTML tooltips which are styleable. Here is the top hit for the Google search "jquery tooltip plugin", reviewing 10 such plugins.

这篇关于是否可以设置标题的样式? (和CSS或js?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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