分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > IT知识

[CSS3] Use Sticky Positioning for Section Headers

发布时间:2023-09-06 02:00责任编辑:顾先生关键词:CSS

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;}

[CSS3] Use Sticky Positioning for Section Headers

原文地址:https://www.cnblogs.com/Answer1215/p/9192527.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved