~~~
<style type="text/css">
svg{
display: block;
border: 1px solid red;
margin: 10px auto;
}
.box{
width: 300px;
height: 300px;
background: skyblue;
transition: -webkit-clip-path 0.5s;
/*-webkit-clip-path:polygon(0 100%,50% 0,100% 100%);*/
/*-webkit-clip-path:circle(50% at 50% 50%);*/
/*-webkit-clip-path:ellipse(30% 20% at 50% 50%);*/
/*-webkit-clip-path:inset(25% 0 25% 0 round 0 25% 0 25%);*/
/*-webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 75%, 75% 75%, 75% 100%, 50% 75%, 0% 75%);*/
/*-webkit-clip-path: polygon(50% 0%, 63% 38%, 100% 38%, 69% 59%, 82% 100%, 50% 75%, 18% 100%, 31% 59%, 0 38%, 37% 38%);*/
-webkit-clip-path: polygon(20% 0%, 0% 0%, 0% 50%, 0% 80%, 0% 100%, 50% 100%, 80% 100%, 100% 100%, 100% 50%, 100% 0%, 80% 0%, 50% 0%);
}
.box:hover{
-webkit-clip-path: polygon(20% 0%, 0% 20%, 30% 50%, 0% 80%, 20% 100%, 50% 70%, 80% 100%, 100% 80%, 70% 50%, 100% 20%, 80% 0%, 50% 30%);
}
</style>
~~~
~~~
<div class="box">
<!--CSS-clip-path案例-->
</div>
<svg width="500" height="300">
<rect x="0" y="0" width="200" height="100" fill="red" />
<circle cx="100" cy="100" r="100" fill="skyblue" />
</svg>
<svg width="500" height="300">
<defs>
<clipPath id="clipPath">
<rect x="0" y="0" width="200" height="100" fill="red" />
</clipPath>
</defs>
<circle cx="100" cy="100" r="100" fill="skyblue" clip-path="url(#clipPath)" />
</svg>
~~~
- 1.Mock.js
- 2.conic-gradient 圓錐漸變
- 3.ES6 Module學習筆記
- 4.ES6函數擴展學習筆記
- 5.導入topojson模塊的坑
- 6.git 內部分享
- 7.npm install --save
- 8.nvm和nrm
- 9.刪除node_modules文件夾
- 10.es6 symbol
- 11.Set和Map數據結構
- 12.chrome控制臺的$0
- 13.d3-ordinal
- 14.Object.assign() 和lodash的merge()
- 15.echarts x軸坐標文字顯示不全
- 16.echarts地圖配置項--中文
- 17.webpack自動瀏覽器打開插件
- 18.D3線條和面積動畫--未采用
- 19.投影濾鏡
- 20.文本擋住觸發事件
- 21圖表用法
- 22.大膽的表現自己把
- 23.裁剪clip-path
- 24svg線條動畫的反向和時間誤差
- 25.visibility和display的區別
- 26.SVG濾鏡
- 27windo命令行的坑
- 28.textContent與innerText的不同
- 29.CSS3炫酷文本
- 30.更改webpack配置文件路徑
- 31.大胖給我做的css codereivew
- 32.定義接口不要限定死
- 33.不使用浮動,用inline-block平分出現換行問題
- 34.輸入框的校驗
- 35.handlbars的registerHelper
- 36.animation-fill-mode
- 37.svg嵌套HTML,實現文本換行
- 38.SVN出現黃色感嘆號
- 39.typeof與instanceof
- 40.SVG里面謹慎設置font-family
- 41.新腳手架里的相對路徑問題