zoukankan      html  css  js  c++  java
  • 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);
      }
       
    
    /*案例 结束*/

    效果:

      初始效果

      鼠标移动上的效果

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

  • 相关阅读:
    封装tip控件
    Javascirpt中创建对象的几种方式
    使用Servlet上传文件
    Struts2 基本配置
    使用JQuery实现手风琴布局
    winform下自绘提示框风格窗体
    环形进度条
    Oracle中获取当前时间半小时前的时间
    JSTL+MyEclipse8.5+Tomcat配置
    使用CSS和jQuery实现对话框
  • 原文地址:https://www.cnblogs.com/shenzikun1314/p/6733243.html
Copyright © 2011-2022 走看看