0

The codes can be found at:

http://www.bootply.com/Z85ieOd2nu

I tried to create a row contains <h2> inlines with <button>. However, I found they are aligned weirdly in the result..

Does anyone have ideas about this? (How to align all of them in center vertically?)

asked Jun 29, 2014 at 9:27
1
  • try #center h2{margin-top:0px; margin-bottom:0px;} Commented Jun 29, 2014 at 9:37

2 Answers 2

1

you can use line-height:70px; in CSS. assign the height of the .row (which in your case it is "70px") to button's CSS and you're done.

http://www.bootply.com/FyZOo7ach4

answered Jun 29, 2014 at 9:36
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! It works for me. However, when I changed the font size of <h2>, it still looks not perfect.. bootply.com/C3sdH3WSMq#
you need to either give it a fixed height, and equal the line-height to that or calculate the height based on the font size of h2
0

Bootstrap gives top and bottom margins to h tags. Here also has top and bottom margins but does not have any margin ( that's why it is stuck to the top ).

To resolve this, either remove the margins from tag or provide top and bottom margin to the tag as(in this case):

button {
 margin-top:20px;
 margin-bottom: 10px;
}
answered Jun 29, 2014 at 10:05

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.