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


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 »

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 »

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 »

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 »

Several methods have been developed in order to use the opportunities of social media in general and Facebook in particular. A very popular method of enhancing audience of a website is getting Facebook 'likes'. A high number of Facebook 'likes' shows that...  more »

If you want to disable the Content Advisor in Internet Explorer, but have forgotten the required password needed to turn Content Advisor off, don't fret. You can easily solve this Content Advisor password issue quickly by making a simple edit to the...  more »

Here are some software applications that will allow you to view web pages even without the presence of the Internet: Instapaper Pocket If these applications are not readily available in your device, then you can always download them from legitimate sites....  more »

Bullies are basically everywhere. They can be found in your school, workplace and even in your favorite social networking site. That’s why it’s not surprising at all to hear individuals complain about being bullied on Facebook. Now, how do you...  more »

In my previous article 'How to Search Google Effectively', I introduced the basic Google search methods and described how we can structure our searches by using special characters and operators. But Google provides a wider range of tools that help us with...  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 »

Most Internet users just enter the phrases they are looking for. This leads to thousands or millions of search result pages that are impossible to review. But the most interesting website may hide somewhere on a page we do not even look at. Google search...  more »

In the past, I've wanted to make a screenshot of an entire web page (even the stuff below the fold) and the only way to do it was to take screenshots of individual sections of the page and then piece them together in photoshop. However, there's a much...  more »