Major difference between “display: none” and “visibility:

Last update on October 29, 2008 01:26 PM by netty5
Published by netty5

Major difference between “display: none” and “visibility: hidden”






There are two attributes that you can use in your webpage, using CSS, to hide the display command in a web browser of an element that has been added in a CSS document. These attributes are “display: none” and “display: hidden”. These attributes do not have the same function however

“display: none” will completely remove the element from the display, that is, it will not consider that the element will be there at all. For example:

#comment
display: none


will not display the comment that has been added to the CSS file. Hence the text will be pulled up, as if no text area was never used before in the document.

“display: hidden” will only hide the part of the element that had to be displayed. Hence, the program will consider that the text is there and will only hide it.

#comment
display: hidden


will leave a blank space where the text was supposed to be. The text will not be pulled up and the area will still be seen by the users.
Best answers for « Major difference between “display: none” and “visibility: » in :
Displaying video from a PC on a television screen Show Displaying video from a PC on a television screen TV output S-Video output Configuration under Windows FAQ You can display the output from the computer on a television (or even the sound on an amplifier). But that implies that the...
Displaying images in web browser ShowDisplaying images in web browser The Flash / Shockwave not displayed When surfing on the internet, you have surely come across small rectangles with red crosses replacing images on the web pages. This may be due to several images on...
How to easily display PHP/HTML codes in your webpages ShowHow to easily display PHP/HTML codes in your webpages Issue What code to use? Issue If you want your visitors to be able to see the source codes of your webpage, there is a very easy way to do so. Normally, all you have to do in a...
The option to display hidden files and folders has disappeared ShowThe option to display hidden files and folders has disappeared Under Windows XP, you may lose the options that allows you to view files and cookies. This is usually due to changes in the register caused by a virus or malicious software on...
Managing images in HTML ShowHow do you display images on a web page? Having a few images on a website can make it more attractive and user-friendly. However, it is important not to go overboard, since images can take a long time to load, and in some cases can make a document...
Computer screen or monitor ShowIntroduction to computer monitors A monitor (or screen) is a computer display unit. There are generally said to be two families of monitors: Cathode-ray tube monitors (or CRT for short), which are used with most desktop computers. They are...
Graphics cards - Video cards Show2D Accelerator Cards A graphics card, sometimes called a graphics adapter, video card or graphics accelerator, is a computer component which converts digital data into a graphical form which can be displayed on a monitor. The initial role of a...