How to get input value in multiple lines in HTML

Does anyone know if there is a way to display the text value of a button in HTML on multiple lines?

I mean, if you block the width of the button in the appropriate CSS and want the text on the button to be on two lines, for example.

Thanks in advance!

+6
html css
source share
4 answers
<input type="button" value="line &#10; break" /> 
+16
source share

You can use the button <button> element, which allows you to style (and text packaging).

The only problem is that if there are several button elements on the same page, you will potentially encounter problems with incorrect transmission of IE6 name / value pairs to the server.

+2
source share

This worked for me (using Chrome, did not test other browsers):

 myButton.Text = "Click \r\n me"; 
0
source share

Divide the text on the button by adding where you want to split the line of the following sequence: \r\n For example: <input type="submit" value="Line1\r\nLine2"> displays a send button with the inscription Line1 on top of line 2.

For beginners: \r\n will not be displayed, but is used by the browser to understand that you want to split the line; no need to leave empty spaces to the left or right of \r\n

0
source share

All Articles