W3.CSS - 顏色



W3.CSS 支援豐富的顏色類。這些顏色類受到營銷、道路標誌和便利貼中使用的顏色的啟發並開發而成。

  • w3-red

  • w3-pink

  • w3-purple

  • w3-deep-purple

  • w3-indigo

  • w3-blue

  • w3-light-blue

  • w3-cyan

  • w3-teal

  • w3-green

  • w3-light-green

  • w3-lime

  • w3-khaki

  • w3-yellow

  • w3-amber

  • w3-orange

  • w3-deep-orange

  • w3-blue-grey

  • w3-brown

  • w3-light-grey

  • w3-grey

  • w3-dark-grey

  • w3-black

顏色主題

W3.CSS 為使用其公共領域主題 CSS 將主題應用於網站提供了極好的支援。以下是一些示例:

序號 CSS 名稱及描述
1

w3-theme-indigo.css

具有靛藍色變體顏色的 CSS

2

w3-theme-red.css

具有紅色變體顏色的 CSS

要使用主題,請訪問https://w3schools.tw/w3css/w3css_downloads.asp下載所需的 CSS 檔案。

示例

w3css_colors.htm

<html>
   <head>
      <title>The W3.CSS Color Themes</title>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <link rel = "stylesheet" href = "https://w3schools.tw/lib/w3.css">
      <link rel = "stylesheet" href = "css/w3-theme-red.css">
   </head>
   
   <body class = "w3-container">
      <h2>Color Theme Demo</h2>
      <hr/>
      <div class = "w3-card-4">
         <div class = "w3-container w3-theme w3-card-2">
            <h1>Red Colored Theme</h1>
         </div>
         
         <div class = "w3-container w3-text-theme">
            <h2>w3-text-theme - Theme for Text</h2>
         </div>
         
         <ul class = "w3-ul w3-border-top">
            <li class = "w3-theme-l5" style = "position:relative">
            <a class = "w3-btn-floating-large w3-theme-action w3-right"
            style = "position:absolute;top:-28px;right:16px;">+</a>
            <p>Using w3-theme-l5 / w3-theme-light style</p>
            </li>
            <li class = "w3-theme-l4"><p>Using w3-theme-l4 style</p></li>
            <li class = "w3-theme-l3"><p>Using w3-theme-l3 style</p></li>
            <li class = "w3-theme-l2"><p>Using w3-theme-l2 style</p></li>
            <li class = "w3-theme-l1"><p>Using w3-theme-l1 style</p></li>
            <li class = "w3-theme"><p>Using w3-theme style</p></li>
            <li class = "w3-theme-d1"><p>Using w3-theme style</p></li>
            <li class = "w3-theme-d2"><p>Using w3-theme style</p></li>
            <li class = "w3-theme-d3"><p>Using w3-theme style</p></li>
            <li class = "w3-theme-d4"><p>Using w3-theme style</p></li>
         </ul>
      </div>
   </body>
</html>

結果

驗證結果。

廣告

© . All rights reserved.