请问您如何在中心对齐此按钮?
<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 :(得分: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>
答案 1 :(得分:0)
在div中包裹按钮并在div上设置text-align:center
<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>