首页 > 其他 > 详细

13.resize妙用(书上看到的)

时间:2017-07-19 15:17:16      阅读:295      评论:0      收藏:0      [点我收藏+]

上效果图

技术分享

 

技术分享

技术分享

准备一张类似比例的图

DOM

<div class="shape-9 box">
    <div>
        <img src="img/bg-2.jpg" alt="before"/>
    </div>
        <img src="img/bg-2.jpg" alt="after"/>
</div>

css

.box{
    height: 300px;
    width: 534px;
    margin: 20px auto;
    border: 1px solid rgba(0,0,0,.16);
    border-radius: 4px;
    overflow: hidden;
}
       .shape-9{
                position: relative;
            }
            .shape-9>div{
                position: absolute;
                top: 0;left: 0;bottom: 0;
                width: 10%;
                max-width: 100%;
                overflow: hidden;
                resize: horizontal;
            }
            .shape-9>div>img{
                
                filter: blur(4px);
            }
            .shape-9>div::before{
                content: ‘‘;
                position: absolute;
                bottom: 0;right: 0;
                width: 12px;height: 12px;
                padding: 5px;
                background: linear-gradient(-45deg,white 50%,transparent 0);
                background-clip: content-box;
                cursor: ew-resize;
                z-index: 1;
            }
            .shape-9 img{
                display: block;
                user-select:none;
            }

 

13.resize妙用(书上看到的)

原文:http://www.cnblogs.com/famLiu/p/7205897.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!