Home  >  Article  >  Web Front-end  >  css 隐藏html元素的方法_html/css_WEB-ITnose

css 隐藏html元素的方法_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:45:25807browse

1、常见方法 display:none

   这个方法的问题是 元素被隐藏了 同时该元素不占位置了,应该也可以说该元素没有高度和宽度了

2、常见方法 visibility: hidden;

   这个方法和display 都是常规的方法 但是 它隐藏了元素后元素还是占着原来的位置的

3、opacity:0

  这个方法 就是通过设置透明度的方法 让元素看不到了

4、position:absolute;left:9999px

 这个方法是让元素浮动到 left的很大的值

更多的方法还在挖掘

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn