HTML5 回到顶部

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>回到顶部</title>
        <link rel="stylesheet" type="text/css" href="css/try.css" />
        <script src="js/app.js"></script>
    </head>
    <body>
        <div  class="box">
                  <img   src="img/jkxy.png"/>
        </div>
        <a style="display:none" href="javascript:;"  id="btn"  title="回到顶部"></a>
    </body>
</html>

  

*{
    margin: 0;
    padding: 0;
}
.box {
    width:1000px;
    margin:  0  auto;
}
#btn {
    width:40px;
    height: 40px;
   position:fixed;
    left:50%;
    bottom:30px;
    background:url(../img/顶部.png)  no-repeat  left top ;
    margin-left: 610px;
}
#btn:hover {
    background:url(../img/顶部.png)  no-repeat  left -40px;
}

  全文:https://www.cnblogs.com/guangzhou11/p/7524950.html

posted @ 2019-07-04 19:21  stma  阅读(770)  评论(0)    收藏  举报