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 this quick tip, you'll learn how to move the cursor on your iPhone or iPad by using the Space Bar (instead of having to drag the cursor itself with your fat fingers).  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 »

Here's how to quickly change the default search engine in Safari for iPhone or iPad, from Google to a different search engine provider such as Yahoo, Bing or DuckDuckGo. To change the Default Search Engine in iOS Safari on iPhone do the following: On your...  more »

By far one of the easiest ways to make money online is to place Google Adsense ads on your blog or website. You make money when visitors come to your site and click on the Google Adsense ads, albeit a little money. The nice thing about Google Adsense is...  more »

Whether you accidentally added someone as a friend on Facebook or just want to cancel a friend request you made to someone, you can cancel the request. Here's how to cancel a Facebook friend request: Visit the person's profile you want to cancel your...  more »

In just a few steps, PayPal makes it really simple for you to create product buy now buttons or links for websites and email. Follow these steps to create a 'Buy Now' Paypal link: Log into your PayPal account. Click on the 'Merchant Services' tab, then...  more »

For about a month now, whenever I visited certain sites like Mashable.com using Internet Explorer 8 browser, I was getting redirected to the mobile browser version of the site instead of the regular web version. This was pretty annoying and I wasn't quite...  more »

This is one of those simple web page design things that can drive a web developer absolutely crazy.  more »

There are different tools of search engine optimization that help web pages to appear higher up in the search engine rankings. One of these methods is link building, the aim of which is to increase the number of inbound links to pages on a website, thus...  more »

Facebook now makes it possible to Link Your Facebook Page to your Twitter account. Essentially, you're able to share status updates, links, photos, notes, and events with your followers on Twitter, directly from your Facebook Page. So things you post to...  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 »

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 »