Does anybody know if there is a way to display the text value of an button in HTML on several lines ?
I mean, if you lock the width of the button in the associated CSS
Split the text on the button by adding where you want to break the line the following sequence: \r\n
For example: <input type="submit" value="Line1\r\nLine2">
will display a submit button with caption Line1 on top of the Line2.
For beginners: \r\n
will not be displayed, but used by the browser to understand that you want to break the line; it is not necessary to leave empty spaces on the left or the right of \r\n
You can use the <button> element, which allows for styling (and text-wrapping).
Only problem with that is that if you have multiple button elements on the same page, you will potentially run into issues with IE6 passing name/value pairs to the server incorrectly.
This worked for me (using Chrome, didn't test other browsers):
myButton.Text = "Click \r\n me";
<input type="button" value="line break" />