Back, at the beginning of the year, I promised to put up some laptop bag porn featuring my various nice 'Powerbags'. As things go this never happened so far. But those of you who have been holding their breath – prepare to go back to breathing soon. The pages with the photos are mostly ready – up to our FTP server not working at the moment and an annoying CSS problem...
... which, I'd like you to solve for me.
The situation should be fairly simple. I am having a list. Each list item contains an image, a linebreak and some text. With everything being centred this makes nice images with captions and I keenly use it for my photo pages, such as Cookie Porn.
Now, all I want to do is have the list items arranged horizontally rather than vertically. To achieve that I played with the CSS and managed to arrange things reasonably with
float:left;. However, this means that my whole list will be at the very left of my page. But I want it to be centred. And can't get that to happen.
I'm not sure what's going wrong here, but something is. So who has done these types of horizontal lists, centred on a page, successfully?
If you add:
margin-left: auto; margin-right: auto;
to the bilder class then it will be centered. I think this does not work on at least some versions of Win IE but I don’t have them here to test (it will just look like it does now on them).
Thanks a lot Matthew! That did the trick.
I tried very similar things but obviously not this one.
Luckily CSS fails to disappoint once more. (I almost switched to a table but that would’ve felt quite naughty…)