最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - how to modify tooltip content font size? - Stack Overflow

programmeradmin3浏览0评论

I feel the font size of the content of tooltip is small. For example, the code is as below:

<span name="explanation" data-toggle="tooltip" title="hello world!"></span>

So how to modify the font size of the showed 'hello world!' when mouse hovering the span element?

I feel the font size of the content of tooltip is small. For example, the code is as below:

<span name="explanation" data-toggle="tooltip" title="hello world!"></span>

So how to modify the font size of the showed 'hello world!' when mouse hovering the span element?

Share Improve this question asked Sep 11, 2017 at 10:49 JustinGongJustinGong 4391 gold badge6 silver badges18 bronze badges 2
  • Look in the page code what element the tooltip is, maybe it has a class where xou can override the defaults. – Matthias Seifert Commented Sep 11, 2017 at 10:56
  • Possible duplicate of How to change the style of Title attribute inside the anchor tag? – Ofisora Commented Sep 11, 2017 at 11:46
Add a ment  | 

2 Answers 2

Reset to default 4

First, start with the following code into the HTML head section: Second, embed a tooltip somewhere on your page using respectivly the following code

 <style type="text/css">
a.tooltip {
	position: relative;
	text-decoration: none;
	color: blue;
}

a.tooltip span {
	display: none;
}

a.tooltip:hover span {
	position: absolute;
	top: 40px;
        font-size: 40px;
	left: 0px;
	display: block;
	width: 250px;
	color: black;
	background-color: #FFFF40;
	border: 1px solid black;
	padding: 5px;
}
</style>
  <a class="tooltip" href="#">this text<span>This help text is shown in the tooltip. It spans multiple lines and works in all browsers.</span></a>

jQuery Tooltip is a good choice. the font size is larger and favorite for me.

发布评论

评论列表(0)

  1. 暂无评论