HTML — Как создать столько объектов, сколько файлов / объектов в Stack Overflow

Я должен сделать .php страницу типа «домашняя страница», которая содержит объекты в зависимости от количества файлов в определенной папке. В следующем коде показан пример того, как должны выглядеть объекты. Я упорядочил их в таблице для облегчения выравнивания.

.index_poster {
display: inline-block;
margin: auto;

width: 16em;
height: 9em;
-moz-box-shadow: 0 0 2em rgb(180,180,180);
-webkit-box-shadow: 0 0 2em rgb(180,180,180);
box-shadow: 0px 0px 2em rgb(180,180,180);
}
<table style="width:100%">
<tr align="center"><td align="center">
<div>
<script type="text/javascript">
function actualNextSibling(el) {    // needed to smooth out default firefox/IE behavior
do { el = el.nextSibling } while (el && el.nodeType !== 1);
return el;
}
</script>

<div onclick="actualNextSibling(this).style.display='block'; this.style.display='none'">
<img class="index_poster" src="posters/BatmanJoker1.jpg" style="cursor: pointer" />
</div>

<div style="display: none">
<video class="index_poster" controls>
<source src="videos/BatmanJoker1.mp4" type="video/mp4">
<source src="" type="video/ogg">
<source src="" type="video/webm">
Your browser does not support the video tag or the file format of this video.
</video>
</div>
</div>
<div>
<form action="https://www.google.com">
<input type="submit" class="button" value="EDIT SUBTITLES">
</form>
</div>
<br><br>
</td>

<td align="center">
<div>
<script type="text/javascript">
function actualNextSibling(el) {    // needed to smooth out default firefox/IE behavior
do { el = el.nextSibling } while (el && el.nodeType !== 1);
return el;
}
</script>

<div onclick="actualNextSibling(this).style.display='block'; this.style.display='none'">
<img class="index_poster" src="posters/BatmanJoker2.jpg" style="cursor: pointer" />
</div>

<div style="display: none">
<video class="index_poster" controls>
<source src="videos/BatmanJoker2.mp4" type="video/mp4">
<source src="" type="video/ogg">
<source src="" type="video/webm">
Your browser does not support the video tag or the file format of this video.
</video>
</div>
</div>
<div>
<form action="https://www.google.com">
<input type="submit" class="button" value="EDIT SUBTITLES">
</form>
</div>
<br><br>
</td></tr><table>

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]