溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

CSS3怎么實現(xiàn)折角效果

發(fā)布時間:2023-01-04 09:25:34 來源:億速云 閱讀:96 作者:iii 欄目:開發(fā)技術

這篇“CSS3怎么實現(xiàn)折角效果”文章的知識點大部分人都不太理解,所以小編給大家總結了以下內容,內容詳細,步驟清晰,具有一定的借鑒價值,希望大家閱讀完這篇文章能有所收獲,下面我們一起來看看這篇“CSS3怎么實現(xiàn)折角效果”文章吧。

<!DOCTYPE html>
<html>
<head>
 <meta charset="UTF-8">
 <title></title>
 <style>
 body {
  background-color: #eaf0f2;
 }
  h2{text-align: center;}
  .box{width:500px;height:300px;margin:0 auto;position:relative;}
  .img-layer{position: absolute;width: 500px;height: 300px;top: 0;left: 0;overflow: hidden;}
  .img-layer img {width: 500px;cursor: pointer;}
  .img-layer:before{ content: '';
   position: absolute;
   top: 0;
   right: 0;
   width: 0;
   height: 0;
   border-style: solid;
   border-width: 0;
   border-color: rgba(0,0,0,0.2) #fff;
   border-radius: 0 0 0 4px;
   box-shadow: 0 1px 1px rgba(0,0,0,0.3), -1px 1px 1px rgba(0,0,0,0.2);
   -webkit-transition: all 0.4s ease-out;
   transition:all 0.4s ease-out;}
 .img-layer:hover:before{
   border-right-width:100px;
   border-bottom-width:100px;
 }
 </style>
</head>
<body>
 <h2>折角效果</h2>
 <div class="box">
  <div class="img-layer">
    <img src="<a href="http://p6.qhimg.com/d/inn/3f563406/table.jpg">http://p6.qhimg.com/d/inn/3f563406/table.jpg</a>" alt="">
  </div>
 </div>
</body>
</html>

css的三種引入方式

1.行內樣式,最直接最簡單的一種,直接對HTML標簽使用style=""。

2.內嵌樣式,就是將CSS代碼寫在之間,并且用進行聲明。

3.外部樣式,其中鏈接樣式是使用頻率最高,最實用的樣式,只需要在之間加上就可以了。其次就是導入樣式,導入樣式和鏈接樣式比較相似,采用@import樣式導入CSS樣式表,不建議使用。

以上就是關于“CSS3怎么實現(xiàn)折角效果”這篇文章的內容,相信大家都有了一定的了解,希望小編分享的內容對大家有幫助,若想了解更多相關的知識內容,請關注億速云行業(yè)資訊頻道。

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI