如何根據 HTML 中的周圍元素設定對齊?


使用 align 屬性設定對齊方式。您可以嘗試執行以下程式碼以在 HTML 中實現 align 屬性 −

注意:HTML5 中不推薦使用 align 屬性。請改用 CSS。

示例

<!DOCTYPE html>
<html>
   <body>
      <p align="right">A right-aligned paragraph.</p>
      <p><b>Note:</b> The align attribute is not supported in HTML5. Use CSS instead.</p>
   </body>
</html>

更新於:02-Mar-2020

634 次瀏覽

開啟您的 職業生涯

完成課程後獲得認證

開始
廣告
© . All rights reserved.