分享web开发知识

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

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

[CSS3] Make a horizontal-scrolling Menu

发布时间:2023-09-06 02:00责任编辑:傅花花关键词:CSS


Our web app on desktop may use elements that use great deal of width. On many occasions we can’t simply turn these elements into columns so that they fit on a small screen. Such elements may not only fit inadequately on small screens, they could ruin the entire layout of our page if we’re not careful. In many cases, we can use a horizontal-scrolling menu to preserve the width, but keep it easily usable.

 ?<nav> ???<a href="">Home</a> ???<a href="">My Profile</a> ???<a href="">Favorites</a> ???<a href="">Links</a> ???<a href="">Tasks</a> ???<a href="">Promotions</a> ???<a href="">Settings</a> ?</nav>
nav { ?display: flex; ?overflow-x: auto; /*Allow children in nav can overflow in x direction*/ ?-webkit-overflow-scrolling: touch; /*Let the scroll more smoothing*/ ?margin: 10px 0;}a { ?margin-right: 20px; ?margin-bottom: 10px; ?white-space: nowrap;}

[CSS3] Make a horizontal-scrolling Menu

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

知识推荐

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