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


Facebook was made to connect people. However, it’s a sad fact that some of the users of the social networking site are quarreling with each other and sending hate messages online simply because of petty issues. This can be a very frustrating...  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 »

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 »

Wouldn't it be cool if you could monitor Twitter conversations in real-time based on certain keywords. Well guess what... you can, and the best part is it's super easy to do. You don't even have to download and install any software. A new website called...  more »

Font Awesome is pretty darn "awesome" for easily adding scalable icons to your website. It also works great with Bootstrap! However, the down side is that with all it's cool icons, more than likely you won't be using most of them on your pages, so loading...  more »

Due to various circumstances, websites can become unavailable for a period of time. Thus, listed below are the services that you can use to be able to view sites even when the website servers are down. Coral Cache Coral Cache comes handy at times when...  more »

Learn how to block unwanted or malicious websites from opening in all versions of Internet Explorer, including IE 8.  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 »

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 »

So are you sure you're ready to cut ties with your friend on Facebook for good? You may want to take a few days before you decide to remove them from your friends list to think about the decision, since this act could really cause more drama than you...  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 »

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 »