I've been trying and failing to have two images side by side with space between them and centered.
I can sort of do it but the bottom table comes up and rest against the bottom of images and no matter what I do it won't move.
In the end I have put them in a table and everything is great but I want to do it with CSS.
Can someone give me the exact CSS and html to make this happen?
Thanks. Graham
DrDoc
8:35 pm on Jul 16, 2013 (gmt 0)
Welcome to WebmasterWorld! Glad to have you here, and hope to see you many more times.
As for your question, it might be good to point out that there's no disconnect between CSS and tables. Tables are HTML, CSS is used to style all HTML elements.
In this case, you are looking at a single property:
text-align
.
You can easily use CSS to tell your images to line up as described.
Thanks for that - yes it does work. How can I increase the white space between the images and also the lower table still clings to the bottom of the images? If I have just one image <br> or <p> gives me the required space between the images and lower table.
Thanks. Graham
DrDoc
9:18 pm on Jul 16, 2013 (gmt 0)
Having a
<br>
certainly works. But there is also no need to introduce markup when it isn't necessary.
By tweaking the CSS above, you can easily achieve what you are looking for. Try giving your images some padding. for example:
.container img { padding: 1em; padding-top: 0; }
grmorley
9:41 pm on Jul 16, 2013 (gmt 0)
Thanks for that - I see how that works but I want to increase the space between the two images - at the moment they are almost touching - before I would have put a blank image between them but sure this isn't the case? Thanks. Graham