Materialize 陰影

2018-01-05 11:12 更新

Materialize有幾個特殊的類來將容器顯示為帶有陰影的紙狀卡。

序號類名稱及說明
1z-depth-0
默認(rèn)情況下刪除具有z深度的元素的陰影。
2z-depth-1
為任何具有1px邊框陰影的HTML內(nèi)容樣式容器。添加z深度1。
3z-depth-2
為任何具有2px邊框陰影的HTML內(nèi)容樣式容器。添加z深度2。
4z-depth-3
為任何具有3px邊框陰影的HTML內(nèi)容樣式容器。添加z深度3。
5z-depth-4
為任何具有4px邊框陰影的HTML內(nèi)容樣式容器。添加z深度4。
6z-depth-5
為任何具有5px邊框陰影的HTML內(nèi)容樣式容器。添加z深度為5。

例字

materialize_shadows.html

<!DOCTYPE html>
<html>
   <head>
      <title>The Materialize Example</title>
	  <meta name="viewport" content="width=device-width, initial-scale=1">      
	  <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
	  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css">
      <script type="text/javascript" src="/attachments/tuploads/materialize/jquery-2.1.1.min.js"></script>           
      <script src="/attachments/tuploads/materialize/materialize.min.js"></script>             
	   <style>
	     div {
		    width : 200px;	
			height : 200px;				
		 } 
	  </style>
   </head>
   <body class="container"> 
      <h2>Materialize Shadow Examples</h2>
      <hr/>
	  <div class="card-panel">
         <p><b>TODO:</b> Learn HTML5</p>
      </div>
      <div class="z-depth-1">
         <p><b>TODO:</b> Learn HTML5</p>
      </div>
	  <div class="z-depth-2">
         <p><b>TODO:</b> Learn HTML5</p>
      </div>
	  <div class="z-depth-3">
         <p><b>TODO:</b> Learn HTML5</p>
      </div>
	  <div class="z-depth-4">
         <p><b>TODO:</b> Learn HTML5</p>
      </div>
	  <div class="z-depth-5">
         <p><b>TODO:</b> Learn HTML5</p>
      </div>	  
   </body>
</html>

結(jié)果

驗證結(jié)果,如下圖所示。


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號