【发布时间】:2019-08-14 12:32:07
【问题描述】:
我有以下页面:
<div class="background">
<section class="statements">
<article>
<div class="article_background hidden" id="forge"></div>
<p>
Greek Mythology states that Hephaistos was the god of blacksmiths, metalworking, carpenters,
craftsmen, artisans, sculptors, metallurgy, fire, and volcanoes.
During his lifetime he accomplished the creation of wonderous items; Achilles armor, Hermes winged
helmet and sandals, even going as far as to create automatons to work for him.
</p>
</article>
</section>
</div>
我想让它不可见。我试过visibility,问题是它仍然占用空间。
我对@987654323@ 和visibility 进行了很多尝试,但结果从来都不是我所希望的。
我正在尝试在纯 css 中完成此操作
【问题讨论】:
-
您在寻找什么结果?你试过
display: none吗? -
您已经尝试了很多
display,但还没有偶然发现none?真的吗? -
如果您仔细阅读它指出的问题
hide the elements for x time,这意味着我希望能够再次显示它们,这在设置为display: none;后不起作用。我已经在 chrome、edge 和 firefox 上对其进行了测试。 @斯科特马库斯 -
@GetOffMyLawn 是的,我试过了,问题是如果你想再次显示它,它根本不起作用。我已经在实际的 Firefox/Chrome/Edge 上对其进行了测试,但它从未起作用,主要是因为与
display: none没有对立面,就像visibility: hidden一样 -
相反的是
display: initial甚至display: block或display: inline或display: inline-block
标签: javascript html css load invisible