posts - 4, comments - 0, trackbacks - 0, articles - 0
            BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理
          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
          <html xmlns="http://www.w3.org/1999/xhtml">
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
          <title>無(wú)標(biāo)題文檔</title>
          <style type="text/css">
          .trans
          {
          -webkit-transition
          : 0.3s ease;
          -moz-transition
          : 0.3s ease;
          -ms-transition
          : 0.3s ease;
          -o-transition
          : 0.3s ease;
          transition
          : 0.3s ease;
          }
          .test_outer
          {
          display
          : block;
          width
          : 200px;
          height
          : 200px;
          margin
          : 1em auto;
          position
          : relative;
          overflow
          : hidden;
          }
          .test_cover
          {
          width
          : 40px;
          height
          : 40px;
          border
          : 200px solid rgba(0, 0, 0, .35);
          border-radius
          : 50%;
          position
          : absolute;
          left
          : -115px;
          top
          : -165px;
          }
          .test_cover:hover
          {
          width
          : 140px;
          height
          : 140px;
          left
          : -170px;
          top
          : -165px;
          }
          .test_cover:hover:after
          {
          content
          : "秋思-一葉知秋!";
          text-align
          :center;
          margin
          :55px 0 0 12px;
          color
          : #fff;
          font
          : bold 16px/1.2 '微軟雅黑';
          text-shadow
          : 1px 1px rgba(0, 0, 0, .35);
          position
          : absolute;
          }
          </style>
          </head>

          <body>

          <a href="#" class="test_outer">
          <span class="test_cover trans"></span>
          <img src="http://center.w3cfuns.com/data/avatar/000/00/64/47_avatar_middle.jpg" width="200" height="200" />
          </a>
          </body>
          </html>

          其實(shí)現(xiàn)原理是利用個(gè)border偌大的半透明邊框?qū)傩裕╠emo中邊框?qū)挾?00像素),邊框顏色為rgba黑色半透明,然后50%圓角。再用用定位把它覆蓋在圖片上面。
          主要核心代碼:

          .test_cover {
          width
          : 40px;
          height
          : 40px;
          border
          : 200px solid rgba(0, 0, 0, .35);
          border-radius
          : 50%;
          position
          : absolute;
          left
          : -115px;
          top
          : -165px;
          }

          然后外面再用個(gè)父容器把它溢出隱藏掉就可以了

          .test_outer {
          display
          : block;
          width
          : 200px;
          height
          : 200px;
          margin
          : 1em auto;
          position
          : relative;
          overflow
          : hidden;

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          免費(fèi)發(fā)布信息分類信息免費(fèi)發(fā)布免費(fèi)發(fā)布推廣信息免費(fèi)B2B
          主站蜘蛛池模板: 涿鹿县| 崇文区| 四平市| 凤山市| 英吉沙县| 五寨县| 海城市| 恩平市| 扶风县| 郯城县| 中山市| 雅安市| 施甸县| 宜章县| 苍山县| 中超| 宜丰县| 石台县| 阿瓦提县| 玛纳斯县| 兴安县| 浮山县| 长葛市| 闻喜县| 汽车| 广丰县| 福贡县| 崇仁县| 阳春市| 准格尔旗| 崇信县| 吴江市| 鲁山县| 宣威市| 东台市| 寿宁县| 南昌县| 双城市| 合肥市| 监利县| 邹平县|