How to Add a Line Break to a Tooltip

by Updated June 1, 2018

It's possible to add line breaks to a HTML ToolTip tag.  To add the line break simply use either the 
 entity or in some cases the \n escaped newline character will work.

In a regular HTML page the ToolTip title tag would look like the following when creating a line break:

-----------------------------------------------

title="First: We will break the line here 
 Second: then continue on this line."

-----------------------------------------------

 

In ASP.NET, the tooltip line break uses \n and would look like this:

-----------------------------------------------

ToolTip="First: We will break the line here \n Second: then continue on this line."

-----------------------------------------------

 

I have only tested this in Internet Explorer 7, so you will want to test this out in Firefox and Safari as well. To test Hover Over This.

Keep in mind there may be a limit to the number of characters you can have in a Tooltip.
 

 

 


0
6

6 Comments

anonymous by Amy on 7/22/2008
Doesn't work in my Firefox 3. The entire tooltip shows up on one line.
anonymous by Doğan on 1/9/2009
Line Breaks in flex...
In flex ide, you can do this with toolTip="Hello
World". But you must use code editor. If you do this with Flex Properties panel, flex converts & char to &amp naturally for xml compability. Use code editor :)
anonymous by Jordi Camps on 4/22/2009
Well, I didn't manage to get the \n working. The 
 separator did work, as proposed by Dogan (from ASP.NET in my case).

But the above only works in IE... it looks like it's impossible to add line breaks in standard tootips in Firefox. The good thing about the 
 solution is that it is transparent in Firefox (no line break but, at least, no other strange chars!)
anonymous by Enrique on 4/27/2010
Thanks. That really helped.

 worked in Google Chrome
anonymous by buddy on 6/8/2011
\r\n also works on chrome (didnt even test \n alone)
anonymous by Charlie on 6/17/2011
Thanks Buddy

Add your comment

by Anonymous - Already have an account? Login now!
Your Name:

Comment:
Enter the text you see in the image below
What do you see?
Can't read the image? View a new one.
Your comment will appear after being approved.

Related Posts


Knowing how to backup your Internet Explorer bookmarked Favorites can come in handy. Especially if you’ve just bought a new computer and want to transfer your favorites list to the new computer, instead of having to re-bookmark every individual website.  more »

Blocking your ads from displaying on crappy sites that don't convert is an essential part of Pay Per Click (PPC) advertising. It's especially important if you're doing Pay Per Click (PPC) advertising with Yahoo Search Marketing since they tend to show...  more »

Adding a CSS border to an ASP.NET Image control was a mystery to me for the longest time. While you could easily use an html image and add the runat="server" to it and then add CSS, I really wanted to use an asp:Image control along with a CSS border....  more »

Craigslist is an online local advertising medium that allows you to post free classified ads on the web. You can get the same type of exposure similar to a garage sale but you do it over the internet. Even if you have never used an online classified site...  more »

In this quick tip, I'll show you how to change the default search engine provider in Internet Explorer 9. By default, Bing is the preset search provider in IE9, but you can change this to Google, Yahoo, or another search engine if you like. Here's how to...  more »

It starts getting pretty anonying when Firefox keeps popping up a box asking to remember passwords everytime you enter a Username and Password for a site. To stop Firefox from doing this, here's a quick tip on how to get Firefox to stop asking to save...  more »

So if you're like me, you may think that the photographs shown on the Bing.com homepage are pretty damn cool. I've actually decided to set Bing.com as my permanent homepage just for the cool pictures they put up everyday. But if you're also like me, you...  more »

Learn how to block unwanted or malicious websites from opening in all versions of Internet Explorer, including IE 8.  more »

In this tutorial, we'll look at how to set up automated reports scheduling in a Yahoo! Search Marketing account. The purpose of setting up reports scheduling is to have your Yahoo Pay Per Click stats sent directly to your email inbox, thus saving you time...  more »

Many people using applications on their phone to access Twitter, have built in "Retweet" buttons, which make it easy to retweet a message posted by someone else. However, if you use the Twitter website interface, they currently do not have a "Retweet"...  more »

Step by step on how-to change your Twitter background image to make a customized Twitter theme. Login to your Twitter account On the menu tab at the top, click on the "Settings" link. Now click on the "Design" tab. You'll be able to change the theme using...  more »

So I’ve been using Bing.com as my default Search Engine for the last two years, after coming to the realization that Google search was getting worse and worse as a search engine, and contained more spammy search results. I now barely ever use Google...  more »