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__________
  • 7,393
  • 6
  • 42
  • 69
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>

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,790
  • 6
  • 21
  • 37
4

CodePen solution

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

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

Anthony Astige
  • 1,919
  • 1
  • 13
  • 18