1. 程式人生 > >三、偽類偽元素

三、偽類偽元素

一、用偽元素做平行四邊形

  

  .button { position: relative; width: 100px; height: 100px; background-color: rgba(0,0,0,.0); margin: 100px; }   .button::before {content: '';position: absolute;top: 0;right: 0;bottom: 0;left: 0;z-index: -1;background: #58a;transform: skew(45deg);}