-1

I have two <button> elements inside a <div> element. Other button has a lot of text that is divided into two or more rows, and other has a little text (one row). How can I give the same height for both buttons?

I'm not trying to get a Javascript or jQuery etc-based answer, but a clean and neet css-based answer, and I'm not trying to animate or manipulate thease elements.

Tohveli
  • 487
  • 5
  • 18

2 Answers2

2

Based on my comments fiddle, you can apply buttons display property to table-cell and achieve the same.

HTML

 <div class="test">
    <button>small text</button>
    <button>this is big text and will go to new line</button>
 </div>

CSS

 .test{display:table;}
 button{width:90px; height:110%; margin:0px 10px; vertical-align:top; display:table-cell;}

DEMO

Suresh Ponnukalai
  • 13,820
  • 5
  • 34
  • 54
-2

You can adjust the padding top and bottom. Visit http://www.w3schools.com/css/css_padding.asp

stathisg
  • 13
  • 8