What happens to the display: initial in browsers without CSS3?

I need to know what / css value will be set when I use display: initial for non-CSS3 compatible browsers?

I hide the class using display:none , and I need to show back, for which I intend to use display: initial (I don't want to use display:block if it used to be display:inline ), but the hidden element will have to be displayed in all browsers .

+4
source share
3 answers

What happens in CSS 2.1 error handling rules , and in practice, is that the display: initial declaration is ignored without affecting the rest of the stylesheet. The display property, therefore, gets its value from other rules. If there are no settings in any stylesheet (including the default stylesheet in the browser), the initial inline value is used.

When you edit your question, the “back-up” code means that the display value will be inline in browsers that support inline and block in other browsers. It does not sound safe.

The initial value does not mean "the previous value specified in the stylesheet" or anything like that, since the question seems to be a postulate. Instead, it means a value that is denoted as the initial value of a property in CSS specifications. For display this is inline .

+5
source

Well, I found that providing a backup would be a safer option. Therefore, I use as below:

 { display: block;// just as fallback display: initial; } 
+1
source

there is a run-in value for the display property described in the W3C Schools page

EDIT: The launch value is supported by Internet Explorer and interprets the element whether it is block or inline.

I made a jsFiddle Example .

+1
source

All Articles