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


In Facebook’s quest to further improve their services to thousands of people all around the world, they have formed a partnership with Skype to provide you with a convenient video chat application. In July 2011, the Skype/Facebook chat became...  more »

Facebook has strict rules regarding pages and your account may be locked out if you ignore them. The page can't be deceptive, misleading or infringe on anyone else's copyright. Moreover, Facebook constantly changes the rules in an effort to limit...  more »

Creating a new group on Facebook is easier than you think. To create a new Facebook group simply login to your Facebook account and then go to the following URL: http://www.facebook.com/groups/create.php Fill out the Group Name and all the groups details,...  more »

A Facebook Page is a public profile that allows you to share your business, products, favorite artist or public figure with Facebook users. Facebook makes it easy to create a "fan" page in just a few minutes Here's how you can create a Facebook fan page:...  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 recently discovered that the Conduit Search Engine had become the default search engine in my Firefox browser. Fortunately, it's pretty simple to remove Conduit from your Search Engine List in Firefox. Here's how you can quickly remove the Conduit...  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 »

Last year our “How to setup a compliant Facebook contest” article described the guidelines of contests on Facebook pages. In the meantime, Facebook changed their rules for contests organized on business pages. Recently a lot of small...  more »

After a recent Norton Internet Security 2009 update, I found that I was now seeing green circle checkmark icons in Google search results. When hovering over the checkmarks a Norton Site Safety box popped up alerting me that the site was safe (or not...  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 »

Google Adwords makes it extremely easy to export your Adwords Campaign into another advertising network. Google allows you to download an export .CSV file of your Adwords Account, Campaigns or Adgroups to your computer, which you can then easily upload...  more »

Most of us use Facebook for several reasons. Moreover, almost all of us are guilty of spending too much time on the social networking website. Well, we can’t be blamed. Facebook provides us with all the news that we need and it easily allows us to...  more »