日常小点总结

mobile弹出数字键盘:<input type="text" placeholder="输入手机号" maxlength="11" pattern="\d*">

超出显示省略号:

.train-communicate .detail .content a{

    width: 268px;

    display: inline-block;

    height: 17px;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    max-width: 268px; /*IE不能解释该属性,而FF可以*/

}

清除浮动:

.clearfix:after{

    visibility: hidden;

    display: block;

    font-size: 0;

    content: " ";

    clear: both;

    height: 0;

}

除了某个dom对象,点击document的其它地方触发一个事件:

$(document).on('click',function(e) {

            var currentDom= e.target;

            if(currentDom!=$('.btn')[0]) {

                alert('123');

            }

        })

移动端禁止用户长按保存图片:

 tap-callout:none

苹果用户safari浏览器给input添加默认样式:

-webkit-appearance: none;

mobiele点击时不出现类似于web端outline的样式:

body {

            background: url("assets/images/bg.jpg") no-repeat;

            outline: 0;

            -webkit-text-size-adjust: none;

            -webkit-tap-highlight-color: rgba(0,0,0,0);

            -webkit-tap-highlight-color: transparent;

        }


你可能感兴趣的:(日常小点总结)