The simplest alternative to this would be to avoid using display: noneand use color transparent:
.hidden {
width:100px;
height:100px;
color: transparent;
background-color: transparent;
}
.display {
width:50px;
height:50px;
color: #000;
background-color: yellow;
display:block;
}
JS Fiddle demo .
It is also possible to use visibilityinstead of display: none:
.hidden {
width:100px;
height:100px;
visibility: hidden;
}
.display {
width:50px;
height:50px;
color: #000;
background-color: yellow;
visibility: visible;
}
JS Fiddle demo .
, ,
visibility: hidden DOM, - ( - , ), ,
visibility: visible.
, , , , , , transparent color ( , , , , , IE, - , ).
, display: none , , , opacity.
, , , , .