Reputation: 439
I want to have a break in a button value on chrome, which used to work fine till their last update 3 weeks ago, since then, that stopped working:
<input type="button" value="line break" />
JSFiddle :
Does anyone have any new ideas to get this line break in an element value ??
Upvotes: 2
Views: 3359
Reputation: 193
Instead of using
<input type="button" />
You should use the button
tag instead, which in turn you can use the HTML <br/>
tag to make your line break. This should work on all browsers as this is a valid HTML code.
<button>
Line<br/>
Break
</button>
Upvotes: 0
Reputation: 43880
input[type="button"] {
white-space: normal;
text-align: left;
width: 6ch;
}
<input type="button" value="line break" />
You can use "white-space: normal"
if you don't want to use <button>
The width of the button could be set to the length of your longest word by the unit measurement ch
one ch
= width of one letter.
Upvotes: 2
Reputation: 76
How about?
<button>
<span>Line 1</span><br/>
<span>Line 2</span>
</button>
Upvotes: 2