遇到容易忘记的问题(一)

/**
 * Created by wdj on 2017/10/24.
 */

  

1.鼠标手的自定义,ie8不兼容

css{
    cursor:url(images/1.png),default;
}

2.a标签

1 <!--拨打电话-->
2 <a href="tel://010-1221556">010-1221556</a>
3 
4 
5 <!--打开新网页-->
6 <a href="javascript:;" target="_blank">新页面的打开</a>
<!--从本页面打开新网页-->
<a href="javascript:;" target="_self">从本页面打开新网页</a>
 

3.现在使用*zoom:1;清除浮动比较少,现在基本改为这样清浮动:

.containt:after{
      conten:'';
      display:table;
      clear:both;
}    

zoom的作用:①检测标签是否闭合,②清除浮动,③样式排除法;但是其原理还是不明白.


4.弹框,一直没有注意过,一直使用rgba写的,但是在ie8不兼容(解决兼容,就是自己找对应的颜色值,参考本文第10条

background:rgba(0,0,0,0.5);  

filter: progid:DXImageTransform.Microsoft.gradient(startcolorstr=#7F000000,endcolorstr=#7F000000)

),

要写出现带阴影的遮罩:先设一个大的div,里面包含两个,一个作为背后阴影,一个作为中间内容,为了防止继承性 
html部分

<div class="tan">
     <div class="bg"></div>
     <div class="tancon"></div>/*屏幕居中*/
</div>

css部分(设定最大最小高度min-height和max-height, 在这个之间的高度可以自适应, 最好tancon外再加一个<div>, 定义宽高但是不给背景, 给tancon背景和padding-bottom )

         .tan {
                width: 100%;
                height: 100%;
                margin: 0 auto;
                display: none;
            }

            .bg {
                width: 100%;
                height: 100%;
                /*兼容IE8及以下版本浏览器*/
                filter: alpha(opacity = 30);
                position: fixed;
                left: 0;
                top: 0;
                bottom: 0;
                right: 0;
                margin: 0 auto;
                z-index: 999998;
                background-color: #666666;
                -webkit-opacity: 0.5;
                -moz-opacity: 0.5;
                -khtml-opacity: 0.5;
                opacity: 0.5;
                filter: alpha(opacity = 50);
                -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
                filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50);
            }
            
            .tancon {
                width: 472px;
                height: 280px;
                position: fixed;
                background-color: #fff;
                top: 0;
                right: 0;
                left: 0;
                bottom: 0;
                margin: auto;
                text-align: center;
                z-index: 999999;
            }

5.在ie8中,input内容不居中,需将input{line-height:;height:;} 

     select不居中,需使用{padding:7px 0px;}

     background-size:200px;//在ie8不被识别;除了网上的一些兼容方法,我的办法还有就是调整一下图片大小,最好是你需要的大小,这样图片的background-size不至于太过夸张的大小.

    有时ie浏览器不会自主解析,如img无宽高时.

猜你喜欢

转载自www.cnblogs.com/wangduojing/p/10397008.html
今日推荐