Blog icon indicating copy to clipboard operation
Blog copied to clipboard

css元素隐藏

Open berwin opened this issue 8 years ago • 3 comments

{ display: none; /* 不占据空间,无法点击 */ }
{ visibility: hidden; /* 占据空间,无法点击 */ }
{ position: absolute; clip:rect(1px 1px 1px 1px); /* 不占据空间,无法点击 */ }
{ position: absolute; top: -999em; /* 不占据空间,无法点击 */ }
{ position: relative; top: -999em; /* 占据空间,无法点击 */ }
{ position: absolute; visibility: hidden; /* 不占据空间,无法点击 */ }
{ height: 0; overflow: hidden; /* 不占据空间,无法点击 */ }
{ opacity: 0; filter:Alpha(opacity=0); /* 占据空间,可以点击 */ }
{ position: absolute; opacity: 0; filter:Alpha(opacity=0); /* 不占据空间,可以点击 */ }
{
    zoom: 0.001;
    -moz-transform: scale(0);
    -webkit-transform: scale(0);
    -o-transform: scale(0);
    transform: scale(0);
    /* IE6/IE7/IE9不占据空间,IE8/FireFox/Chrome/Opera占据空间。都无法点击 */
}
{
    position: absolute;
    zoom: 0.001;
    -moz-transform: scale(0);
    -webkit-transform: scale(0);
    -o-transform: scale(0);
    transform: scale(0); 
    /* 不占据空间,无法点击 */
}

berwin avatar Jan 21 '16 09:01 berwin

Good

codezyc avatar Jan 25 '16 03:01 codezyc

pointer-events: none; 

这个属性也蛮好玩的 鼠标事件拜拜, 比如做个水印层在页面

sammok avatar Jul 17 '18 07:07 sammok

@sammok 哈哈哈,查了下资料,确实挺有意思的,,学习了~😁😁

berwin avatar Jul 17 '18 08:07 berwin