我無法居中我的photoslideshow .... 我希望你們能幫助我。如何居中Photoslideshow
Photoslideshow在HTML:
<div class="w3-content w3-section" style="max-width:500px">
<img class="mySlides" src="4.jpg">
<img class="mySlides" src="3.jpg">
<img class="mySlides" src="2.jpg">
</div>
<script>
var myIndex = 0;
carousel();
function carousel() {
var i;
var x = document.getElementsByClassName("mySlides");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
myIndex++;
if (myIndex > x.length) { myIndex = 1 }
x[myIndex - 1].style.display = "block";
setTimeout(carousel, 2500);
}
</script>
請爲w3-content w3-section添加樣式定義 – Ruby