Reputation: 33986
I know that adding text-center
to div classes is sufficient for centering a group of buttons. But in my situation I need to center the text inside the buttons.
I tried to add margin-left, margin-right, text-center. But didn't help.
Is it possible to center the text ?
<div id="mydiv">
<a href="#" class="btn btn-warning btn-lg text-center"
style="width:48px;margin-left:auto;margin-right:auto;">Ad</a>
...
...
</div>
fiddle: http://jsfiddle.net/mavent/YXrRT/3/
Upvotes: 0
Views: 96
Reputation: 2323
check the jsfiddle
,you should remove margin-left:auto,margin-right:auto inline code
http://jsfiddle.net/YXrRT/6/
Upvotes: 0
Reputation: 5930
You padding on the buttons is too large (16px horizontally). Try changing the padding to 10px
or less.
Also you should consider using CSS classes instead of style
attributes to avoid repetition.
Upvotes: 1
Reputation: 2126
Don't give any custom CSS like width and margins remove them and it will work. You use Bootstrap so you don't have to use custom stylings for buttons
Upvotes: 0
Reputation: 1852
Try removing
margin-left:auto;margin-right:auto;
from
<a href="#" class="btn btn-warning btn-lg text-center" style="width:48px;margin-left:auto;margin-right:auto;">Pp</a>
Upvotes: 0