html - Center Javascript Slideshow? -
this question has answer here:
- how horizontally center <div> in <div>? 72 answers
i beginner @ coding , answers have come across have gone straight on head. code have make slideshow work (which working) is:
<script type="text/javascript"> <!--> var image1=new image() image1.src="congo.jpg" var image2=new image() image2.src="snow.jpg" var image3=new image() image3.src="mekong.jpg" //--> </script>
and in body section:
<img src="congo.jpg" name="slide" width="400" height="300"> <script type="text/javascript"> <!-- var step=1 function slideit(){ document.images.slide.src=eval("image"+step+".src") if(step<3) step++ else step=1 settimeout("slideit()",2500) } slideit() //--> </script>
i have no clue how center or put in margin. tried placing within table manipulate location, didn't work (assuming it's not easy), , tried messing around tag center pulling @ strings! proper way add margin/center? thank you.
you need put <div>
around slideshow , apply text-align:center
div.
<div style="text-align:center;"> <img src="congo.jpg" name="slide" width="400" height="300"> </div>
quick , dirty example: https://jsfiddle.net/pbsz9spu/
Comments
Post a Comment