Javascript “我的图像”幻灯片下方不显示的内容

Javascript “我的图像”幻灯片下方不显示的内容,javascript,html,css,slideshow,Javascript,Html,Css,Slideshow,在w3schools和其他一些资源的帮助下,我成功地编写了一个快速响应的图像滑块,但是我无法在图像幻灯片下方显示任何内容。只是没有出现。你可以在代码中看到填充段落。没有出现。我尝试了不带内容div类和。我知道这不是段落本身,因为它可以在其他页面上完全正常工作 <div class="slideshow-container"> <div class="mySlides fade"> <div class="numbertext">1 / 3</div

在w3schools和其他一些资源的帮助下,我成功地编写了一个快速响应的图像滑块,但是我无法在图像幻灯片下方显示任何内容。只是没有出现。你可以在代码中看到填充段落。没有出现。我尝试了不带内容div类和。我知道这不是段落本身,因为它可以在其他页面上完全正常工作

<div class="slideshow-container">

<div class="mySlides fade">
  <div class="numbertext">1 / 3</div>
  <img src="img1/img1.jpg" style="width:100%">
  <div class="text">Caption Text</div>
</div>

<div class="mySlides fade">
  <div class="numbertext">2 / 3</div>
  <img src="img1/img2.jpg" style="width:100%">
  <div class="text">Caption Two</div>
</div>

<div class="mySlides fade">
  <div class="numbertext">3 / 3</div>
  <img src="img1/img3.jpg" style="width:100%">
  <div class="text">Caption Three</div>
</div>

</div>
<br>

<div style="text-align:center">
  <span class="dot"></span> 
  <span class="dot"></span> 
  <span class="dot"></span> 
</div>

<script>
var slideIndex = 0;
showSlides();

function showSlides() {
  var i;
  var slides = document.getElementsByClassName("mySlides");
  var dots = document.getElementsByClassName("dot");
  for (i = 0; i < slides.length; i++) {
    slides[i].style.display = "none";  
  }
  slideIndex++;
  if (slideIndex > slides.length) {slideIndex = 1}    
  for (i = 0; i < dots.length; i++) {
    dots[i].className = dots[i].className.replace(" active", "");
  }
  slides[slideIndex-1].style.display = "block";  
  dots[slideIndex-1].className += " active";
  setTimeout(showSlides, 9000); // Change image every 2 seconds
}
</script>
            <div class="header">
<h1>yeet</h1>
 <p>
            Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

            The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.</p>

幻灯片容器的高度为0。
里面的图像有自己的高度,覆盖了下面的文字。 如果删除高度:0
.slide container
,将显示段落

.slideshow-container {
  height: 0; /* <-- Remove this line */
}
.slideshow容器{

高度:0;/*以上HTML代码是否完整?
.slideshow-container {
  height: 0; /* <-- Remove this line */
}