如何在 HTML 中更改元素的文字顏色?


使用 color 屬性在 HTML 中顯示文字顏色。

注意 − 此屬性在 HTML5 中不受支援。

示例

你可以嘗試執行以下程式碼來學習如何在 HTML 中實現 color 屬性 −

<!DOCTYPE html>
<html>
   <head>
      <title>HTML Background Colors</title>
   </head>
   <body>
      <table width = "100%">
         <tr>
            <td>
               <p><font color="blue">This is demo text.</font></p>
            </td>
         </tr>
      </table>
   </body>
</html>

更新於:24-6-2020

8K+ 瀏覽

開啟你的 職業生涯

透過完成課程獲得認證

開始
廣告