css3滚动条
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta content="telephone=no" name="format-detection" />
<title>评分有半个星星</title>
<style type="text/css">
/*公共部分*/
/**
* reset 浏览器重置属性
* global 公共样式(单一块样式)
* common 常用属性,对应的单个属性(class原则上不要超过3个类)
* public 公共模块(模块样式啊,有层级)
*/ /*reset*/
html{max-width: 640px;margin:0 auto;}
article,aside,dialog,footer,header,section,footer,nav,figure,menu{display:block}
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, figure, section, legend, textarea, p, blockquote, th, td, input, select, textarea, button { margin: 0; padding: 0 }
fieldset, img { border: 0 none }
body{font:14px/1.4 "Microsoft Yahei",Arial,Helvetica,sans-serif;background-color: #fff;color:#333;max-width: 640px;margin: 0 auto;}
h1,h2,h3,h4,h5,h6{font-size:100%;font-weight: normal;}
table{border-collapse:collapse;border-spacing:0}
ul,ol,dd,dt,dl{list-style-type:none;}
a{color:#333;text-decoration: none;-webkit-touch-callout: none;-webkit-user-select: none;}
a,input,select{-webkit-tap-highlight-color: transparent;-webkit-appearance: none;-moz-appearance: none;-webkit-border-radius: 0;} input,img{border:none;}
i,em{font-style:normal;}
:focus{outline: none}
select{ background: none } /*iphone6*/
@media(min-device-width:375px)and(max-device-width:667px)and(-webkit-min-device-pixel-ratio:2){body{font-size:14.5px;}}
/*iphone6plus*/
@media(min-device-width:414px) and (max-device-width:736px) and (-webkit-min-device-pixel-ratio:3){body{font-size:15.5px;}} /*原子类*/
.clear { clear: both; }
.clear:after { display: block; clear: both; visibility: hidden; height: 0; overflow: hidden; content: "."; }
.left { float: left; }
.right { float: right; }
.mb10{margin-bottom: 10px;}
.mt10{margin-top: 10px;}
.auto { overflow: hidden; }
/*公共结束*/ /*导航*/
.head{ height: 40px; line-height: 40px; text-align: center; font-size: 20px; }
.nav{ height: 40px; line-height: 40px; border-top:1px solid #ddd; border-bottom:1px solid #ddd; width: 100%; overflow: hidden; position: relative; }
.n_more{ width: 40px; height: 40px; border-left:1px solid #ddd; background: #ddd; position: absolute;right: 0; top:0; }
.n_more em { margin: 10px auto 0; display: block;
width:0; height:0;
border-left:8px solid transparent;
border-right:8px solid transparent;
border-top:8px solid #0066cc;
}
.n_menu{white-space: nowrap;/*white-space: nowrap;规定段落中的文本不进行换行*/
overflow-x: scroll;/*overflow-x: scroll;提供滚动机制*/
-webkit-overflow-scrolling: touch;/*-webkit-overflow-scrolling: touch;有快速滚动和回弹的效果*/}
.n_menu::-webkit-scrollbar {display: none}
.n_menu a{ padding: 0 10px; border-right: 1px solid #ddd; } </style>
</head>
<body>
<div class="head">css3滚动条</div>
<div class="nav">
<span class="n_more"><em></em></span>
<div class="n_menu">
<a href="#">标题1</a>
<a href="#">标题2</a>
<a href="#">标题3</a>
<a href="#">标题4</a>
<a href="#">标题5</a>
<a href="#">标题6</a>
<a href="#">标题7</a>
<a href="#">标题8</a>
<a href="#">标题9</a>
<a href="#">标题10</a>
<a href="#">标题11</a>
<a href="#">标题12</a>
</div>
</div>
<p style="color: red; padding: 10px;">注意:要切换成手机模式才可以滚动,PC端不行</p> </body>
</html>
如图所示:

例子2
<div class="m-nav-wrap">
<ul class="m-nav">
<li><a href="">首页</a></li>
<li><a href="">八字起名</a></li>
<li><a href="">八字起名</a></li>
<li><a href="">公司起名</a></li>
<li><a href="">宠物起名</a></li>
<li><a href="">英文起名</a></li>
<li><a href="">游戏起名</a></li>
<li><a href="">百家姓</a></li>
<li><a href="">起名大全</a></li>
<li><a href="">免费算命</a></li>
</ul>
</div>
css样式:
.m-nav-wrap{ height: .8rem; line-height: .8rem; overflow: hidden;}
.m-nav{ white-space: nowrap;overflow-x: scroll;-webkit-overflow-scrolling: touch; }
.m-nav-wrap::-webkit-scrollbar {display: none}
.m-nav li{ display: inline-block;}
.m-nav-wrap a{ padding: 0 10px; display: block;}
例子3:
html:
<div class="index-sx">
<a href="">鼠</a>
<a href="">牛</a>
<a href="">虎</a>
<a href="">兔</a>
<a href="">龙</a>
<a href="">蛇</a>
<a href="">马</a>
<a href="">羊</a>
<a href="">猴</a>
<a href="">鸡</a>
<a href="">狗</a>
<a href="">猪</a>
</div>
css样式:
.index-sx{ overflow: hidden;white-space: nowrap;overflow-x: scroll;-webkit-overflow-scrolling: touch; padding-top: .2rem; padding-left: .1rem; }
.index-sx a{ display: inline-block; background: #ddd; border-radius: .1rem; width: 1rem; height: 1rem; line-height: 1rem; text-align: center; font-size: .48rem; margin: 0 .15rem;}
效果图:

css3滚动条的更多相关文章
- css3 滚动条出现 页面不跳动
.wrap-outer { margin-left: calc(100vw - 100%); } .wrap-outer { padding-left: calc(100vw - 100%); } ...
- CSS3滚动条美化,CSS3滚动条皮肤
CSS3 -webkit-scrollbar滚动条皮肤美化实现,利用-webkit-scrollbar,-webkit-scrollbar-track,-webkit-scrollbar-thumb这 ...
- NB的CSS样式集锦1——CSS3滚动条美化,CSS3滚动条皮肤
转自:http://www.pengyaou.com/codecss3/POKDNMS_112.html CSS3 -webkit-scrollbar滚动条皮肤美化实现,利用-webkit-scrol ...
- css3滚动条样式美化
关于滚动条的设计,需要用到css3的微元素,都列在下边吧(以Chrome内核webkit为例). -webkit-scrollbar 滚动条的整体轮廓,width表示纵向滚动条的宽度,heig ...
- CSS3滚动条-webkit-scrollbar
webkit现在支持拥有overflow属性的区域,列表框,下拉菜单,textarea的滚动条自定义样式. 如果你想跳过介绍,直接看demo的话,请点击demo 滚动条是一个伪元素,可以自定义样式.这 ...
- less/sass 基础base文件
less less-base.less文件展示: //清除标签默认样式; .label(){ ;;;_background-image:url(n1othing.txt)} ;;; font-size ...
- 微信小程序 - 自适应swiper高度(非组件)
微信小程序swiper默认高度375rpx,一旦超过这高度,就滑动不到内容了,我们利用css3可以很简单做到这件事情 原理: 利用css3 横轴滚动属性overflow:scroll,设置死swipe ...
- CSS3自定义滚动条样式 -webkit-scrollbar(转)
有没有觉得浏览器自带的原始滚动条很不美观,同时也有看到很多网站的自定义滚动条显得高端,就连chrome32.0开发板都抛弃了原始的滚动条,美观多了.那webkit浏览器是如何自定义滚动条的呢? 前言 ...
- CSS3自定义滚动条样式 -webkit-scrollbar
今天写项目碰上需要改滚动条效果,我的第一反应是,需要用js写滚动条,顿时头大,上网搜了一下,原来css3就可以修改滚动条样式了,非常好啊,下面分享原文地址:http://www.xuanfengge. ...
随机推荐
- Python编辑器IDLE傻瓜入门
转自:http://bbs.csdn.net/topics/390451617 下载python进行安装,默认自带此工具开始->程序->Python 2.*/3.*-> IDLE ( ...
- CCS5连接调试C64X系列DSP核
CCS从3.3改版为5.X之后,CCS 变化很大.DaVinci芯片中DSP的调试步骤也不同了.这里介绍下在CCS里如何调试DaVinci的DSP核心 1. 创建CCS V5版本的project 本人 ...
- python 中的type
1. type(object) -> the object's type 返回的是object的类型,即对象的类定义 例如:用元类动态生成子类metaclass = type(father) ...
- Spark之 使用SparkSql操作Hive的Scala程序实现
依赖 <dependency> <groupId>org.apache.spark</groupId> <artifactId>spark-hive_2 ...
- java动态规划问题
这里是简单的动态规划问题.其实,如果我们学过数据结构,应该就接触过动态规划问题,当时一直没有反应过来.我们求最小生成树用的是贪婪算法.而求最短路径就是动态规划.从一个点出发,到另外每个点的最短距离.在 ...
- 关于使用PL/SQL连接本地oracle时报错:ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务解决
转自:https://blog.csdn.net/a657281084/article/details/49490069 问题:Oracle主服务和监听器服务已经启动,使用SQL Plus能够正常连接 ...
- 606. Construct String from Binary Tree 从二叉树中构建字符串
[抄题]: You need to construct a string consists of parenthesis and integers from a binary tree with th ...
- sourcetree免注册方法
step1: https://www.sourcetreeapp.com/官网下载windows版软件 step2: 右键-->以管理员身份运行,便安装成功了 step3: 安装好之后会有这么一 ...
- list count++
AtomicInteger count = customTypeCounter.get(order.getCustomerType()); if (count == null) { count = n ...
- code1796 社交网络
输入描述 Input Description 输入文件中第一行有两个整数,n 和 m,表示社交网络中结点和无向边的数 目.在无向图中,我们将所有结点从 1 到 n 进行编号. 接下来 m 行,每行用三 ...