zoukankan      html  css  js  c++  java
  • 【HTML+CSS】精灵图(雪碧图)+侧边栏固定

    需求:实现下图效果(精灵图+侧边栏固定屏幕)

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <title>精灵图+侧边栏固定</title>
        <style type="text/css">
            body {
                padding:0;
                margin:0;
            }
            .section {
                text-align: center;
                padding: 20px;
                height:700px;
                color: #fff;
            }
    /*        #nav {
                position: fixed;
                bottom:20px;
                right:10px;
                120px;
                height: 521px;
            }*/
            .a1 {
                display: block;
                position: fixed;
                top: 171px;
                right: 10px;
                width: 120px;
                height: 35px;
                background : url(./navbar.png) no-repeat -1px -50px;
            }
            .a2 {
                display: block;
                position: fixed;
                top: 211px;
                right: 10px;
                width: 120px;
                height: 35px;
                background : url(./navbar.png) no-repeat -1px -91px;
            }
            .a3 {
                display: block;
                position: fixed;
                top: 251px;
                right: 10px;
                width: 120px;
                height: 35px;
                background : url(./navbar.png) no-repeat -1px -130px;
            }
        </style>
    </head>
    
    
    <body>
        <div class="section" id="section01" style="background:#369;">
            <h2>五折抄底</h2>
        </div>
        <div class="section" id="section02" style="background:#f90;">
            <h2>疯狂秒杀</h2>
        </div>
        <div class="section" id="section03" style="background:#abc;">
            <h2>电视家影</h2>
        </div>
        
    
    
        <div id="nav">
            <!-- <img src="./navbar.png"> -->
            <a href="#section01" class="a1"></a>
            <a href="#section02" class="a2"></a>
            <a href="#section03" class="a3"></a>
        </div>
        
    
    </body>
    </html>

  • 相关阅读:
    Vim 配置 winmanager
    删除字符串中重复字符
    检查字符串中是否存在重复字符
    字符串逆序输出
    shell 循环使用
    Windows下JNI执行步骤
    JNI中使用cl命令生成DLL文件
    javaZIP压缩文件
    java Mail发送邮件
    关于在同一个DIV下的Hover效果问题
  • 原文地址:https://www.cnblogs.com/neymargoal/p/9470873.html
Copyright © 2011-2022 走看看