Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it safe to use the css property "visibility"?

Tags:

visibility

css

Is it safe to use the css property "visibility"? Will it work in all major browsers?

like image 694
pedrozath Avatar asked Jan 07 '11 13:01

pedrozath


People also ask

What is the use of visibility in CSS?

The visibility CSS property shows or hides an element without changing the layout of a document. The property can also hide rows or columns in a <table> .

Which of these is true about visibility hidden in CSS?

visibility: hidden - this CSS property makes the text invisible, but the space allocated for it will remain. In other words, the element is hidden from view but not the page flow.

Is visibility hidden accessible?

visibility: hidden and assistive technology When we apply visibility: hidden to an element, it also removes it from the accessibility tree, which makes it invisible to technologies like screen readers.

What is the CSS visibility property How is it different from the display property?

The visibility property specifies whether or not an element is visible. Tip: Hidden elements take up space on the page. Use the display property to both hide and remove an element from the document layout!


2 Answers

According to W3Schools it's supported in all major browsers.

Please consider if you are actually looking to use visibility as the element will still take up space on the page (it will just appear blank). If you want it to be as if the element isn't on the page at all then consider using display:none instead.

like image 183
Jonathon Bolster Avatar answered Sep 28 '22 02:09

Jonathon Bolster


according to http://www.w3schools.com/css/pr_class_visibility.asp yes:

The visibility property is supported in all major browsers.

like image 31
maid450 Avatar answered Sep 28 '22 02:09

maid450