码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2017-07-19 15:30:42      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:add   ati   content   log   code   .com   效果   near   user   

上效果图

技术分享

 

技术分享

技术分享

准备一张类似比例的图

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妙用(书上看到的)

标签:add   ati   content   log   code   .com   效果   near   user   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!