7

Hello guys how to newline or break inside a input button?. I have this code:

<input type="button" id="Button" value="RECOMMEND DISAPPROVE" disabled="disabled" style="width:125px; height: 35px;"/>

I tried <br/> but not working..

diiN__________
  • 6,914
  • 6
  • 40
  • 64
Traf De Law
  • 143
  • 1
  • 1
  • 8
  • Sorry for being beginner but i'm using this button to disapprove a request but word "RECOMMEND" is all i can see. – Traf De Law Jun 27 '16 at 07:30
  • Did you try – ib11 Jun 27 '16 at 07:35
  • You can make a line break using the CSS `word-break` property or CSS `flex-wrap`property. Find how to use them here: [How to Create Button with Line Breaks](https://www.w3docs.com/snippets/html/button-with-line-breaks.html) at W3docs – Astghik Arakelyan Jan 11 '19 at 10:49

2 Answers2

5

You may want to use the <button> attribute as <input> doesn't support the newline tags. So you could do this for example:

<button type="button" id="Button" disabled="disabled" style="width:125px; height: 35px;">RECOMMEND<br />DISAPPROVE</button>

See fiddle: https://jsfiddle.net/nk35ux2p

You may want to remove the button width/height as the text doesn't fit well in the button

I hope this will help you.

node_modules
  • 4,122
  • 4
  • 18
  • 34
4

CodePen solution

<button>Line one<br/>line two</button>

It appears <input type="button"> doesn't support line breaks

Anthony Astige
  • 1,869
  • 11
  • 17