There are lots of tools and applications – some free, some paid – which create photo side shows or photo galleries. Elsewhere I have shown how to create a photo gallery which uses the visible css property to provide a degree of animation and how to use use a low-cost application. Here, I will describe an approach that produces a slide show using only basic HTML and very simple CSS.
Using the CSS Overflow Property
My earliest memory of photographic slides was my father’s slide projector which operated on the simple principle that you fed a single slide in from the left and drew it across behind the lens and then pulled it out on the other side.
This first solution uses the CSS overflow property to achieve a similar result in HTML.
The slide show looks like this:
The html to create this page is shown below:
I have left the CSS information as inline tags to make them explicit. You should be able to copy and paste this HTML into a text file and view it with your browser, although you will need to find your own images!
The key elements are:
- The …. tags act as a container. The width is set to 1000 pixels. The overflow property means that the contents will scroll, allowing each picture to be seen by using the scroll bar.
- The overwide table is set to a width of 7500 pixels, or 10 times the cell width of 750 pixels.
- Within each cell, a picture is centered vertically and horizontally, each 750 x 600 cell contains an image at 640 x 480 pixels.
You can set the widths to match your image size and the table width to match the number of images you wish to see.
You can set the background to a color of your choice or a texture if preferred.
In a live site, I would move the CSS information into an external style sheet. This way, you could create a series of pages all linked to a contents page.