DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   HTML and CSS (http://www.daniweb.com/forums/forum143.html)
-   -   Linefeed in image title (http://www.daniweb.com/forums/thread155751.html)

ingeva Nov 6th, 2008 4:35 pm
Linefeed in image title
 
I have tried to insert a linefeed in the "title=" text in an <img> tag.

Both \n and <br /> are shown exactly as written.
Is there a trick to make it actually break the line?

sillyboy Nov 6th, 2008 8:58 pm
Re: Linefeed in image title
 
From what I have read, there shouldn't actually be new lines in the title attribute. BUT if you do want to try, use " " which is a carriage return. In firefox, the return is converted to a space, but in IE you will see a line break in the tool tip (which I think is incorrect behaviour).

Hope that helps...

ingeva Nov 7th, 2008 4:20 am
Re: Linefeed in image title
 
Quote:

Originally Posted by sillyboy (Post 730316)
From what I have read, there shouldn't actually be new lines in the title attribute. BUT if you do want to try, use "
" which is a carriage return. In firefox, the return is converted to a space, but in IE you will see a line break in the tool tip (which I think is incorrect behaviour).

Hope that helps...

Thanks, I tried that, and you're right: In FireFox it's just a space.
There should be a better solution, but I guess I'll just not show any title but open a small message box instead.


All times are GMT -4. The time now is 6:12 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC