css3 動態條紋邊框程式碼例項
分享一段程式碼例項,它實現了當滑鼠懸浮元素之上,會出現動態條紋邊框效果。
程式碼例項如下:
[HTML] 純文字檢視 複製程式碼<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="author" content="http://www.softwhy.com/" /> <title>螞蟻部落</title> <style> body { padding: 20px; } ul, li { list-style:none; } .product { width: 176px; padding: 5px; position: relative; /*float: left;*/ } .product > img { display: block; position: relative; cursor:pointer; } .product:hover .product-hover, .product:active .product-hover { opacity: 1; } .product-hover { position: absolute; top: 0; left: 0; right: 0; bottom: 0; opacity: 0; -webkit-transition: opacity 0.3s ease; -moz-transition: opacity 0.3s ease; transition: opacity 0.3s ease; background-size: 30px 30px; background-image: -webkit-linear-gradient(45deg, rgba(234, 176, 176, 1) 25%, transparent 25%, transparent 50%, rgba(234, 176, 176, 1) 50%, rgba(234, 176, 176, 1) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(45deg, rgba(234, 176, 176, 1) 25%, transparent 25%, transparent 50%, rgba(234, 176, 176, 1) 50%, rgba(234, 176, 176, 1) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(234, 176, 176, 1) 25%, transparent 25%, transparent 50%, rgba(234, 176, 176, 1) 50%, rgba(234, 176, 176, 1) 75%, transparent 75%, transparent); -webkit-animation: barberpole 0.5s linear infinite; -moz-animation: barberpole 0.5s linear infinite; animation: barberpole 0.5s linear infinite; } @-webkit-keyframes barberpole { from { background-position: 0 0; } to { background-position: 60px 30px; } } @-moz-keyframes barberpole { from { background-position: 0 0; } to { background-position: 60px 30px; } } @keyframes barberpole { from { background-position: 0 0; } to { background-position: 60px 30px; } } .main { margin:10px auto; text-align:center; overflow:hidden; } </style> </head> <body> <div class="main"> <ul> <li class="product"> <div class="product-hover"></div> <img src="demo/CSS/img/ant.jpg"> </li> </ul> </div> </body> </html>
相關文章
- css條紋邊框程式碼例項CSS
- css3螞蟻線邊框程式碼例項CSSS3
- css3實現的多重邊框程式碼例項CSSS3
- css3鋸齒形邊框效果程式碼例項CSSS3
- CSS3圖片邊框陰影效果程式碼例項CSSS3
- CSS條紋背景程式碼例項CSS
- 文字嵌入邊框程式碼例項
- css多重邊框程式碼例項CSS
- css3實現div邊框陰影效果程式碼例項CSSS3
- css3實現的邊框陰影效果程式碼例項CSSS3
- js動態建立文字框程式碼例項JS
- css內邊框效果程式碼例項CSS
- css邊框陰影程式碼例項CSS
- css半透明邊框程式碼例項CSS
- div虛線邊框程式碼例項
- jQuery動態進度條程式碼例項jQuery
- css3動態背景圖片程式碼例項CSSS3
- css實現半透明邊框程式碼例項CSS
- outline兩層邊框程式碼例項
- CSS設定邊框為透明程式碼例項CSS
- CSS3邊框動態環繞效果CSSS3
- CSS3環繞動態邊框效果CSSS3
- css3自定義滾動條樣式程式碼例項CSSS3
- css3半透明邊框程式碼CSSS3
- CSS設定元素邊框樣式例項程式碼CSS
- css3實現的斑馬紋效果程式碼例項CSSS3
- css3實現的動態大白效果程式碼例項CSSS3
- css3實現平行四邊形程式碼例項CSSS3
- CSS3繪製平行四邊形程式碼例項CSSS3
- SVG設定邊框的透明度程式碼例項SVG
- css3晃動效果程式碼例項CSSS3
- CSS3實現的平行四邊形程式碼例項CSSS3
- css3實現的進度條程式碼例項CSSS3
- 滑鼠懸浮底部具有動態延伸條效果程式碼例項
- 美化滾動條效果程式碼例項
- css3邊框顏色漸變且四角有內凹圓形程式碼例項CSSS3
- CSS3星系運動效果程式碼例項CSSS3
- css隱藏滾動條程式碼例項CSS