1. 程式人生 > 其它 >box-shadow 盒子陰影

box-shadow 盒子陰影

1. html 結構

<div class="container">
    <div class="box">
      <h3>Heading</h3>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ullam aspernatur illum in? Nihil ullam iusto, vitae laboriosam nisi suscipit pariatur aliquid unde aliquam assumenda corporis.</p>
    </div>
    <div class
="box"> <h3>Heading</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ullam aspernatur illum in? Nihil ullam iusto, vitae laboriosam nisi suscipit pariatur aliquid unde aliquam assumenda corporis.</p> </div> <div class="box"> <h3>Heading</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ullam aspernatur illum in
? Nihil ullam iusto, vitae laboriosam nisi suscipit pariatur aliquid unde aliquam assumenda corporis.</p> </div> </div>

2. css樣式

.container {
      display: flex;
    }
    .box {
      padding: 1rem;
      margin: 1rem;
      background-color: coral;
      color: #ffffff;
      box
-shadow: 10px 10px teal; box-shadow: -5px 5px 20px rebeccapurple; box-shadow: 3px 3px 5px blue, -3px -3px 5px green; }

3. 講解

1.  box-shadow: 水平陰影 垂直陰影 陰影模糊 模糊擴散 陰影顏色 內外陰影; 2.  box-shadow: 水平陰影 垂直陰影 陰影模糊 陰影顏色, 水平陰影 垂直陰影 陰影模糊 陰影顏色;