zoukankan      html  css  js  c++  java
  • CSS3实现侧边栏收缩

    完整代码:

    <!DOCTYPE >
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <style>
    body {
        padding:0px;
        margin:0px;
        text-align: center;
        font-family:'微软雅黑',Trebuchet MS,Verdana,Helvetica,Arial,sans-serif;
        background-color: #FAFAFA;
    }
    body.sideMenu{ 
    margin:0; 
    -webkit-transform:none; 
    transform:none; 
    }
    #sideToggle{ 
    display:none; 
    }
    #sideToggle:checked + aside{ 
    left:0;
     }
    #sideToggle:checked ~ #wrap{ 
    padding-left:120px;
     }
    aside{ 
    position:absolute; top:0; bottom:0; left:-110px; 
    width:110px; 
    background:#005e99;
    transition:0.2s ease-out; 
    -webkit-transition:0.2s ease-out;
    z-index:100;
     }
    #wrap{
         margin-left:0px; padding:0px 0px 0px 0px;
          transition:0.25s ease-out; 
          -webkit-transition:0.25s ease-out; }
    #wrap > label{ 
    display:inline-block; 
    }
    #wrap > label{ 
          float:left;
          background:#005e99;
          border-radius:50px;
          color: #FFF;
          cursor: pointer;
          display: block;
          font-family: Courier New;
          font-size: 25px;
          font-weight: bold;
          width: 30px;
          height: 30px;
          line-height: 35px;
          text-align: center;
          text-shadow: 0 -4px;
        }
    #wrap > label:hover{ 
    background:#000; 
    }
    h2{
        color: #FFF;
    }
    </style>
    </head>
    <body>
    <input type='checkbox' id='sideToggle'>
    <aside>
    <h2>Hello!</h2>
    </aside>
    <div id="wrap">
         <label id='sideMenuControl' for='sideToggle'>=</label>
      </div>
    </body>
    </html>
     
  • 相关阅读:
    A*算法实现 八数码问题
    poj 1077 Eight(bfs,dbfs, A*)
    poj 1729 Jack and Jill (搜索,bfs)
    poj 4105 拯救公主(bfs)
    poj4091The Closest M Points(KD-tree)
    资源整理
    推荐 VS2010入门教程—鸡啄米
    Cstring的使用
    VC 中TEXT、_T、L的区别
    电脑内存和CPU的关系
  • 原文地址:https://www.cnblogs.com/pilee/p/3450867.html
Copyright © 2011-2022 走看看