Forum Moderators: not2easy
display property works. Each element is like a cardboard box. You are asking for the outer box (#list) to be closed, but an inner box (#show1) to be open. The browser actually does exactly what you ask it to do, but since the outer box is closed, you still cannot see the contents of the inner open box. display property dynamically (using JavaScript) or is it hard coded in the stylesheet?
none
This value causes an element to not appear in the formatting structure (i.e., in visual media the element generates no boxes and has no effect on layout). Descendant elements do not generate any boxes either; the element and its content are removed from the formatting structure entirely. This behavior cannot be overridden by setting the 'display' property on the descendants.
visibility: hidden is a perfectly viable option, and appears to also be the best option in this case. visibility: hidden is by far the cleanest and easiest to read solution I would be able to think of.
#list>* {
display:none;
}
#list>#show1{
display:block;
}
<ul id="list">
<li id="show1">one
<ul>
<li>show1 one</li>
<li>show1 two</li>
<li>show1 three</li>
</ul>
</li>
<li id="show2">two
<ul>
<li>show2 one</li>
<li>show2 two</li>
<li>show2 three</li>
</ul>
</li>
</ul>