• [CSS3] Use Sticky Positioning for Section Headers


    We can take advantage of sticky positioning to keep a section header at the top of the page while the user scrolls. This is useful for neat categorisation of sections on the page.

      <dl>
        <dt>Premier League</dt>
        <dd>Brighton & Hove Albion 2 - 2 AFC Bournemouth</dd>
        <dd>Burnley 1 - 2 Liverpool</dd>
        <dd>Leicester City 3 - 0 Huddersfield Town</dd>
        <dd>Stoke City 0 - 1 Newcastle United</dd>
        <dd>Everton 0 - 1 Manchester United</dd>
    
        <dt>Championship</dt>
        <dd>Bolton Wanderers 1 - 0 Hull City</dd>
        <dd>Derby County 1 - 1 Sheffield United</dd>
        <dd>Leeds United 0 - 0 Nottingham Forest</dd>
        <dd>Norwich City 2 - 1 Millwall</dd>
        <dd>Preston North End 2 - 3 Middlesbrough</dd>
        <dd>Queens Park Rangers 2 - 1 Cardiff City</dd>
        <dd>Sheffield Wednesday 0 - 3 Burton Albion</dd>
        <dd>Sunderland 0 - 1 Barnsley</dd>
        <dd>Aston Villa 3 - 0 Bristol City</dd>
    
        <dt>League 1</dt>
        <dd>AFC Wimbledon 2 - 0 Southend United</dd>
        <dd>Bristol Rovers 2 - 1 Portsmouth</dd>
        <dd>Charlton Athletic 1 - 2 Gillingham</dd>
        <dd>Fleetwood Town 1 - 2 Bradford City</dd>
        <dd>Northampton Town 0 - 1 Wigan Athletic</dd>
        <dd>Oxford United 3 - 1 Milton Keynes Dons</dd>
        <dd>Peterborough United 1 - 1 Doncaster Rovers</dd>
        <dd>Plymouth Argyle 1 - 0 Walsall</dd>
        <dd>Rochdale 1 - 2 Blackpool</dd>
        <dd>Rotherham United 1 - 1 Blackburn Rovers</dd>
        <dd>Scunthorpe United 1 - 0 Bury</dd>
        <dd>Shrewsbury Town 1 - 0 Oldham Athletic</dd>
      </dl>
    dl {
      font-size: 30px;
    }
    
    dt {
      background-color: mediumseagreen;
      position: sticky;  /*sticky positioning*/
      position: -webkit-sticky;
      top: 0;
    }
    
    dd {
      padding: 20px 0;
    }

  • 相关阅读:
    tomcat7
    SSO
    搜索服务Solr集群搭建 使用ZooKeeper作为代理层
    JavaScript
    JavaScript中给onclick绑定事件后return false遇到的问题
    ES6.0简单了解
    php之gennerator
    RBAC权限管理及使用原生PHP实现
    使用YII框架的migrate迁移数据库
    shell脚本--文件包含
  • 原文地址:https://www.cnblogs.com/Answer1215/p/9192527.html
Copyright © 2020-2023  润新知