• css做鼠标指向图片图片放大但边框不放大


    这是一个圆形边框做的效果

    HTML

    <div class="circle-wrapper">
      <img src="" >
    </div>

    CSS

    .circle-wrapper,
    .circle-wrapper img {
      display: inline-block;
       50px;
      height: 50px;
      border-radius: 50%;
      -webkit-transition: .3s;
      transition: .3s;
    }
    
    .circle-wrapper {
      border: 1px solid #ddd;
      position: relative;
      overflow: hidden;
    }
    
    .circle-wrapper img {
      position: absolute;
    }
    
    .circle-wrapper img:hover {
      -webkit-transform: scale(2);
      transform: scale(2);
    }

    自己做的案例:

    HTML

    <div style="position:absolute; top: 0px; left: 0px;  100%; min- 1200px;">
        <!--案例 开始-->
            <div id="cases">
                <div id="al-list">
                    <div class="al-items">
                    <span>WORKS/案例</span>
                    </div>
                    <div class="al-right">
                              
                                <a class="a-item" href="#" rel="all">所有</a>
                            
                                <a class="a-item" href="#" rel="vi">VI</a>
                            
                                <a class="a-item" href="#" rel="baozhuang">包装</a>
                            
                                <a class="a-item" href="#" rel="huace">画册</a>
                               
                                <a class="a-item" href="#" rel="gongcheng">工程</a>
                           
                                <a class="a-item" href="#" rel="guanggao">广告</a>
                           
                    </div>
                </div>
                
                <div class="al">
                    <div class="anli">
                        <div class="four-anli">
                        
                           <a href="#"><img src="dt_img/a1.jpg" /></a>
                        </div>
                        <div class="four-anli">
                            <a href="#"><img src="dt_img/a2.jpg"  /></a>
                        </div>
                        <div class="four-anli" >
                            <a href="#"><img src="dt_img/a3.jpg"  /></a>
                        </div>
                        <div class="four-anli" >
                            <a href="#"><img src="dt_img/a4.jpg" /></a>
                        </div>
                    </div>
                    <div class="anli">
                        <div class="four-anli" >
                           <a href="#"> <img src="dt_img/a5.jpg"  /></a>
                        </div>
                        <div class="four-anli" >
                           <a href="#"><img src="dt_img/a6.jpg"/></a>
                        </div>
                        <div class="four-anli" >
                           <a href="#"> <img src="dt_img/a7.jpg"/></a>
                        </div>
                        <div class="four-anli" >
                            <a href="#"><img src="dt_img/a8.jpg" /></a>
                        </div>
                    </div>
                    <div class="anli">
                        <div class="four-anli" >
                            <a href="#"><img src="dt_img/a9.jpg" /></a>
                        </div>
                        <div class="four-anli" >
                            <a href="#"><img src="dt_img/a10.jpg" /></a>
                        </div>
                        <div class="four-anli" >
                            <a href="#"><img src="dt_img/a11.jpg"  /></a>
                        </div>
                        <div class="four-anli" >
                            <a href="#"><img src="dt_img/a12.jpg"/></a>
                        </div>
                    </div>
               </div>
            </div>
    </div>

    CSS

    /*案例 开始*/
    #cases{
        clear:both;
        position:relative;
        100%;
        height:800px;
        padding:40px 0px;
        
        }
    #al-list{
        80%;
        margin-left:10%;
        position:relative;
        
        height:30px;}
    .al-items{
        float:left;
        position:relative;
        75%;
        height:30px;
        
        }    
    .al-right{
        float:left;
        position:relative;
        margin-right:0px;
        25%;
        height:30px;
        
        }
    .a-item{
        margin-left:10px;
        margin-right:10px;
        
        }
        
        
        
        
        
    .al{
        position:relative;
        padding:30px 0}
    .anli{
        80%;
        position:relative;
        margin-left:10%;
        margin-top:20px;
        height:200px;
    }
    
    .four-anli,.four-anli img{
        display:inline-block;
        
        height:200px;
        -webkit-transition: .3s;
          transition: .3s;
        }
    .four-anli{
        23%;
        position:relative;
        float:left;
        margin-left:2%;
        border:1px solid #000;
        right:1%;
        overflow:hidden;
        }
    .four-anli img{
        100%;
        position:absolute;
       }
    .four-anli img:hover{
        -webkit-transform: scale(2);
          transform: scale(2);
      }
       
    
    /*案例 结束*/

    效果:

      初始效果

      鼠标移动上的效果

    发现第二张图片有变化了吗

  • 相关阅读:
    UVa 11572
    Codeforces Round #500 (Div. 2) C.Photo of The Sky
    C++中的1LL
    Codeforces Round #500 (Div. 2) ABC
    UVA11054 Wine trading in Gergovia
    UVA 11134 Fabled Rooks (贪心)
    uva1152
    牛客网暑期ACM多校训练营(第一场)A Monotonic Matrix(数学公式+思维)
    牛客网暑期ACM多校训练营(第三场)A.PACM Team(多重01背包)
    普通平衡树
  • 原文地址:https://www.cnblogs.com/shenzikun1314/p/6733243.html
Copyright © 2020-2023  润新知