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


A stalker on Facebook is someone who can be hard to get rid of especially when you don’t have what it takes to be rude to them. If you don't completely defriend them, his person will stay as your friend in the social networking site and will...  more »

It's clear Facebook is the biggest social networking site around the world. Almost everybody is using it and people stay connected with one another because of this amazing platform. Having a Facebook account can give you a lot of advantages. However,...  more »

Facebook allows you to tag your friends in your status updates using the @ symbol. The tagging feature in facebook is similiar to that of Twitter, but you don't need to know your friends "@username" to use the tag. Instead follow these instructions to tag...  more »

To find text on a web page in Internet Explorer 9 (IE9), you can use the "Find" search bar, which is built into IE9. In IE9, the "Find on this page" function is now in the Tools menu. To quickly open up the "Find" search bar, use the Find keyboard...  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 »

Using Facebook began with curiosity. We wanted to know what’s going on and we wanted to be considered “in” so that’s why almost all of us created our respective accounts. However, this social networking site can easily become an...  more »

Amazon Prime Day 2017 has finally arrived and now we have a first hand look at many of the days featured deals. Most of these Prime Day deals will not be live until 9 pm on July 10th and will run through July 11th, so take advantage of them while they...  more »

Here's a quick tip on how to make Internet Explorer your Default web browser: Open Internet Explorer. Click on the Tools menu, then select Internet Options. In the Internet Options pop-up box, select the Programs tab. Then in the Default web browser...  more »

If you recently bought a new Dell computer, and then opened up Internet Explorer you may have been automatically redirected to (Dell's) dell.msn.com web page in Internet Explorer, instead of being directed to www.msn.com. This hijacked dell.msn.com URL...  more »

We bump into thousands of images nowadays, and sometimes you might like to know where a particular image was taken or who a person is in a particular photo. Using Google Image Search you can now quickly search for similar images to help you find out what...  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 »

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 »