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


使用 background-blend-mode 屬性使用 CSS 設定每個背景層的混合模式。您可以嘗試執行以下程式碼,使用 background-blend-mode 屬性並將模式設定為“darken”

示例

即時演示

<!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>

更新於: 2020-06-25

56 次瀏覽

開始你的 職業生涯

透過完成課程獲得認證

開始
廣告
© . All rights reserved.