Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何对齐这个按钮_Html - Fatal编程技术网

Html 如何对齐这个按钮

Html 如何对齐这个按钮,html,Html,你能给我解释一下如何把这个按钮对准中心吗 <script type="text/javascript" src="https://office.instantticketing.com/pit/scripts/pit-widget-boot.js"></script> <button onclick="javascript:pitWidgetBootToken('khaxfcarjhtso4h9lubk5ywwcp21386707097031');">

你能给我解释一下如何把这个按钮对准中心吗

<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>

现在预订

最好的方法是使用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>

现在预订

查看。

将按钮包装在div中,并将文本对齐:居中放置在div上


现在预订
<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>