使用 CSS 混合每個背景層的混合模式


使用 background-blend-mode 屬性,透過 CSS 設定每個背景層的混合模式。你可以嘗試執行以下程式碼,以實現背景混合模式屬性,並將模式設定為變暗

示例

即時演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         #myDIV {
            width: 250px;
            height: 170px;
            background-repeat: no-repeat, repeat;
            background-image:url("https://tutorialspoint.tw/assets/videotutorials/courses/3d_animation_online_training/380_course_211_image.jpg"),url( https://tutorialspoint.tw/latest/dc.js.png);
            background-blend-mode: darken;
         }
      </style>
   </head>
   <body>
      <h1>Set Blend Mode</h1>
      <div id = "myDIV"></div>
   </body>
</html>

更新時間:25-Jun-2020

56 次瀏覽

職業啟動

完成課程,獲得認證

開始
廣告
© . All rights reserved.