移动Web开发基础-reset样式
来源:互联网 发布:xp打开1433端口 编辑:程序博客网 时间:2024/05/19 23:15
详细分解
1、禁止ios和android用户选中文字
.css{-webkit-user-select:none;}
2、禁止ios长按时触发系统的菜单,禁止ios&android长按时下载图片
.css{-webkit-touch-callout: none}
3、webkit去除表单元素的默认样式
.css{-webkit-appearance:none;}
4、修改webkit表单输入框placeholder的样式
input::-webkit-input-placeholder{color:#AAAAAA;}input:focus::-webkit-input-placeholder{color:#EEEEEE;}
5、去除android a/button/input标签被点击时产生的边框 & 去除ios a标签被点击时产生的半透明灰色背景,这里起作用的主要是设置透明度为0。
a,button,input{-webkit-tap-highlight-color:rgba(255,0,0,0);}
6、禁止ios使用-webkit-text-size-adjust调整字体大小(默认情况下旋转设备的时候文字大小会发生变化)
body{-webkit-text-size-adjust: none;}
7、android 上去掉语音输入按钮
input::-webkit-input-speech-button {display: none;}
8、移动端定义字体,移动端没有微软雅黑字体,各系统平台一般用默认字体,关于为什么如此,可以学习一下 移动web页面使用字体的思考。
/* 移动端定义字体的代码 */body{font-family: "Helvetica Neue", Helvetica, STHeiTi, Arial, sans-serif;}
9、局部滚动(仅iOS 5以上支持)
-webkit-overflow-scrolling:touch;//一般配合overflow: scroll/auto;使用
10、有时为了布局方便也会重置盒子模型
* { box-sizing: border-box;}
常用重置
移动端web页面开发时常用的重置样式如下,开发时应根据具体情况来修改重置样式。
/* Reset S */*{ box-sizing: border-box; }body, h1, h2, h3, h4, h5, h6, hr, p, pre, dl, dt, dd, ul, ol, li, th, td, form, fieldset, legend, button, input, textarea, figure, figcaption, nav, footer, menu, blockquote { margin: 0; padding: 0;}h1, h2, h3, h4, h5, h6 { font-size: 100%; font-weight: normal;}address, em, i, b { font-style: normal;}a, a:hover, a:active, a:visited { color: #576B95; text-decoration: none;}ul, ol, li { list-style: none;}fieldset, img { border: 0;}html { font-size: 100%;}button, input, select, textarea { font: 16px/1.5 "Helvetica Neue", Helvetica, STHeiTi, sans-serif; outline: none;}textarea, input { background: none; border-radius: 0; -webkit-appearance: none; resize:none;}table { border-spacing: 0; border-collapse: collapse;}body { word-wrap: break-word; font: 16px/1.5 "Helvetica Neue", Helvetica, STHeiTi, sans-serif; color: #fff; background-color: #000; max-width: 750px; margin: 0 auto;}* { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box;}select { -webkit-appearance: none; appearance: none;}/* Reset E */
阅读全文
0 0
- 移动Web开发基础-reset样式
- 【读书笔记】HTML5移动Web开发指南 --- 移动Web界面样式
- 移动web开发清除默认样式设置
- 移动Web开发基础-Viewport
- 移动Web应用程序开发 HTML5基础
- 移动Web开发基础-meta锦集
- 移动Web开发基础-比例盒子
- 移动Web开发基础-rem布局
- 移动Web开发基础-flexible布局方案
- 移动web开发,ios下移除input默认样式
- 移动Web界面样式-CSS3
- 移动web特别样式处理
- 移动Web开发基础-百分比+flex布局方案
- 移动Web开发基础-flex弹性布局(兼容写法)
- 移动Web开发基础-利用VW单位适配布局
- 移动Web窗体基础
- 移动开发----自定义样式 Dialog
- 移动端web开发filter:blur()样式进行模糊处理使用心得
- 百度对HTTPS站点全流程支持方案
- windows下使用nexus搭建maven私服(一)
- Python3.5——Json与pickle数据序列化
- 【下】安全HTTPS-全面详解对称加密,非对称加密,数字签名,数字证书和HTTPS
- 专访新浪微博黄波:千人千面,机器学习赋能用户信息流消费
- 移动Web开发基础-reset样式
- C++11 并发指南一(C++11 多线程初探)
- 关于Set中Entry的使用
- Java读取CSV文件并导出
- 饿汉式单例模式在多线程中并发访问的解决方案
- Date函数处理
- Android空引用问题的解决方法——on a null object reference
- Python超过R,成为数据科学和机器学习的最常用语言
- 山东教师教育网研修平台-报名