On Jul 2, 7:57*am, czechboy <oldrich.s...@gmail.comwrote:
Hi,
I can use document.body.style.display="none" to hide whole page but
then if I want to display one div only by
document.getElementById("centerPage").style.displa y="" it does not
work...
document.getElementById("centerPage").style.displa y=""
Changes the style attribute. So whatever was in the cascade above (e.g
a stylesheet), will be applied to the element. If the most specific
cascading stylesheet rule for that element had display: none, then
setting display="" the browser will apply that cascaded rule to that
element.
It is also entirely possible that the element's ancestor has display:
none, so in that case, setting the display of the element itself will
change it's style attribute but it won't generate any box for that
element (which is not rendered because its ancestor is not).
display can be, but is not by default, inherited. If the element has
display: inherit, it will take on the value of the element's parent's
display (inherit doesn't work in IE). However, if the element has an
ancestor with display: none, then it is not rendered (regardless of
whatever display it may have inherited from its parent). It will still
generate no box, no matter what.
[snip]
thanks ;)