zoukankan      html  css  js  c++  java
  • 优秀前端工程师必备: (总结) 清除原生ios按钮样式

    写移动端的web开发时, 需要清除IOS本身的各种样式:

    1.消除ios按钮原生样式, 给按钮加自定义样式:

    input[type="button"], input[type="submit"], input[type="reset"],input[type=text],input[type=password]
    { -webkit-appearance: none; } textarea { -webkit-appearance: none;}

    2.有圆角话

    .button{ border-radius: 0; } 

    3.去除Chrome等浏览器文本框默认发光边框

    input:focus, textarea:focus {    outline: none;}

    4.去掉高光样式:

    input:focus{    -webkit-tap-highlight-color:rgba(0,0,0,0);    -webkit-user-modify:read-write-plaintext-only;}

     5.所有浏览器下的文本框的边框都不会有颜色上及样式上的变化了,但我们可以重新根据自己的需要设置一下

    input:focus,textarea:focus {    outline: none;    border: 1px solid #f60;}

    6.去除IE10+浏览器文本框后面的小叉叉 

    input::-ms-clear {    display: none;}

    7.禁止textarea拖拽放大  

    textarea {    resize: none;}

    在这里要提到一个属性resize,这个是CSS3属性,用于元素缩放,它可以取以下几个值:

    none 默认值

    both 允许水平方向及垂直方向缩放

    horizontal 只允许水平方向缩放

    vertical 只允许垂直方向缩放

    不仅可以针对textarea元素,对大多数元素都适用,如div等,在这里不一一列举,但与textarea不同的是,对div使用时需要加上一句overflow: auto;,也就是这样才有效果:

    div {    resize: both;    overflow: auto;}


    --------------------- 本文来自https://blog.csdn.net/wjy397/article/details/55803499?utm_source=copy 

  • 相关阅读:
    node.js+mysql接口入门
    input边写边验证?正则表达式写在属性里?小技巧
    创建vue,react项目
    jquery在网页中加载本地json文件
    OpenFeigin服务接口调用
    Ribbon负载均衡服务调用
    Consul服务注册与发现
    Eureka服务注册与发现
    springboot项目在idea实现热部署
    设计模式——单例模式
  • 原文地址:https://www.cnblogs.com/autoXingJY/p/9759171.html
Copyright © 2011-2022 走看看