Djokito Djokito - 1 year ago 76
HTML Question

Create a HTML page displaying GIFs with a Batch File

I need to display a lot of GIF pictures in one place, and being able to add some whenever I want.
The solution I have found is to create a batch file which creates an HTML page displaying the GIF. But I'm a beginner with CMD language and after some research here is what I have written :

FOR /F %%G IN ('dir /B *.gif') DO echo ^<img src="%%G"^>^ ^<br^>^<br^>^<br^> >> gifs.html

It works but it is really simple, and I don't seem to be able to add page settings and layout (such as center the GIFs, maybe add a background etc...) automatically from the Batch. I can't find anything on the web as to how to do that. Can someone put me on the rails here ?

Thanks very much !!


cdm cdm
Answer Source

you can create separate static CSS file (named e.g.: your.css) in the same folder containing something like:

  text-align: center;
  background-color: #aaaaaa;

  width: 300px;

and then add this line to the beginning of your batch file:

echo ^<link type="text/css" href="your.css"^> >> gifs.html
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download