2014-04-25 115 views
-1

您能否请我解释一下如何在中心对齐此按钮?如何对齐此按钮

<script type="text/javascript" src="https://office.instantticketing.com/pit/scripts/pit-widget-boot.js"></script> 
<button onclick="javascript:pitWidgetBootToken('khaxfcarjhtso4h9lubk5ywwcp21386707097031');"> 
    <span style="text-align: center; line-height: 1.0; font-size: 16px; text-transform: none;">Book now</span> 
</button> 

回答

0

要做到这一点,最好的方法是使用CSS;例如:

.button_centre { 
    margin:auto; 
    display:block; 
} 

和HTML/JS/

<button onclick="javascript:pitWidgetBootToken('khaxfcarjhtso4h9lubk5ywwcp21386707097031');" class="button_centre"> 
    <span style="text-align: center; line-height: 1.0; font-size: 16px; text-transform: none;"> 
     Book now 
    </span> 
</button> 

退房的Fiddle of this question

0

包裹按钮,在一个div和具有的text-align:在DIV

http://jsfiddle.net/ykZgJ/

<div style="text-align:center"> 
<button onclick="javascript:pitWidgetBootToken('khaxfcarjhtso4h9lubk5ywwcp21386707097031');"><span  style="text-align: center; line-height: 1.0; font-size: 16px; text-transform: none;">Book now</span></button> 
</div> 
中心