CSS中如何让元素隐藏?
在CSS中,让元素隐藏(指屏幕范围内肉眼不可见)的方法很多,有的占据空间,有的不占据空间;有的可以响应点击,有的不能响应点击。下面一个个列出,选一个适合你的
{ display: none; /* 不占据空间,无法点击 */ }
{ visibility: hidden; /* 占据空间,无法点击 */ }
{ 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);
/* 不占据空间,无法点击 */
}
关键词:CSS
相关阅读
- 11-28一些常用的div 布局名称CSS命名规则整理
- 05-25喜欢在DreamWeaver中编写CSS代码的朋友应该了解的几个习惯
- 02-12div+css文字垂直居中
- 02-12修改外部链接,email链接,pdf链接的CSS样式代码
- 02-12修改一般的ipad屏幕布局CSS代码
- 02-12创建多个边框box阴影css代码
- 02-12CSS浏览器重置代码
- 09-15CSS布局中的一些基础属性
- 05-28div+css的网页排版技巧
- 03-03二十个最常用的CSS经典技巧
阅读本文后您有什么感想? 已有 人给出评价!
用户评论
热门评论
最新评论
相关软件
热点图文
- 05-31CSS中如何让元素隐藏?
- 04-19网页设计配色应用教程之各种色彩对比分析
- 04-07IE与Firefox的CSS兼容大全
- 01-10div+css下js浮动对联广告不随屏幕滚动的解决方法
- 04-16marquee基本语法的全解释
- 04-07CSS的学习应该注意学习方法
- 04-16创建一个纯CSS的水平导航条
- 04-07网页框架和网页框架集如何工作的
- 05-25喜欢在DreamWeaver中编写CSS代码的朋友应该了解的几个习惯
- 02-12修改一般的ipad屏幕布局CSS代码