私はしばらくの間これをやってきましたが、なぜ私のDIVを表示するように戻すことができないのかわかりません。それは、私のCSSファイルのdisplay:noneで始まります。ボタンをクリックすると、スタイルがdisplay = 'block'に変更されます。私はそれをクリックするとDIVを閉じたい出口ラベルを持っています。私はvisibility = 'hidden'でそれをすることができますが、なぜdisplay = 'none'がうまくいかないのか分かりません。DIVがdisplay = 'none'(JavaScript onclick)に変更されないのはなぜですか?
<button class="btn" onclick="document.getElementById('abo').style.display = 'block';">Learn More</a>
<div id="abo">
<?php include 'about-more.php';?>
<div id="about-more">
<h2>Learn More</h2><br>
<a href="http://youngmarists.org/">For more info on Young Marists</a><br>
<p>Contributers to this website</p>
<?php
foreach($profiles as $profile => $item):
?>
<section class="profile">
<h4 class="name"><?php echo $item['name'];?></h4>
<p class="role"><?php echo $item['role'];?></p>
<img class="profile-img" src="profiles/<?php echo $item['img'];?>"></img>
</section>
<?php endforeach;?>
<i class="fa fa-times-circle fa-2x" onclick="document.getElementById('abo').style.display = 'none';"; style="position:fixed;top:6%;right:18%;"></i>
</div>
visibility:実際に表示されずにボタンと終了ラベルの両方を表示すると、hiddenが実際には機能しません。 –