setting particular part of the tool tip text to be bold with different font color

流过昼夜 提交于 2020-02-05 04:54:47

问题


i have tool tip for an image in asn asp.net & c#.net and i want to set particular part of the tool tip text to be bold with different font color,

how can that be done?


回答1:


Here is some nice CSS-only tooltip behavior which you could use to customize your tooltips: http://meyerweb.com/eric/css/edge/popups/demo.html which is done by using :hover selector for span element inside a.

HTML:

<a href="http://sample.com/">Links<span>Tooltip text</span></a>

CSS:

div#links a span {display: none;} // hide our tooltip SPAN.
div#links a:hover span {
  display: block; // show our tooltip
  // position/style tool-tip here.
}

Try including a <span>bold text here</span> within the tooltip span from this example and style it appropriately with css. Such as

div#links a span span {font-weight: bold;}

A simpler example here.. In this example you would add the following style instead:

a.info span span {font-weight: bold;}


来源:https://stackoverflow.com/questions/3178377/setting-particular-part-of-the-tool-tip-text-to-be-bold-with-different-font-colo

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!