1.span元素居中
使span中元素居中,直接使用text-align是無效的,因爲span是行內元素,所以必須將其轉換爲block才能生效
<span style="text-align:center,display:block"}}>hello</span>
2.button居中
要使兩個button居中,可以在其父級放置一個div,然後設置div的style 爲 text-algin:center
<div style="text-align:center">
<button>one </button>
<button>two </button>
</div>