pwindy  
在完成任务的同时,还需要不断“复盘”,不论你多么的忙,都需要留下时间思考,可以思考哪些地方做的好,哪些地方我们可以改进,应该如何改进,注重总结才是王道

效果图

 

 

1.html布局代码

                <div class="log">
                    <a href="javascript:;"></a>
                </div>

2.css代码

            .log{
                width: 55px;
                height: 55px;
                display: inline-block;
                background-color: $colorA;
                a{
                    display: inline-block;
                    width: 110px;
                    height: 55px;
                    &:before{
                        content: '';
                        @include imgIcon(55px, 55px, "/imgs/mi-home.png", center, contain);
                        transition: 1s;
                    }
                    &:after{
                        content: '';
                        @include imgIcon(55px, 55px, "/imgs/mi-logo.png", center, contain);
                    }
                    &:hover:before{
                        margin-left: -55px;
                        transition: 1s;
                    }
                }
            }

其中imgIcon函数作为mixin引入的,如下

@mixin imgIcon($w:0,$h:0,$url:'',$position:center,$size:cover){
    display:inline-block;
    width:$w;
    height:$h;
    background-image:url($url);
    background-repeat:no-repeat;
    background-position:$position;
    background-size:$size;
}

 

posted on 2021-08-26 17:31  pwindy  阅读(71)  评论(0编辑  收藏  举报