Quarter Life Crisis

The world according to Sven-S. Porst

« Bread, Milk, DrugsMainSmart People »

CSS Question

211 words

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?

September 29, 2004, 0:22


Comment by Matthew Walker: User icon

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).

September 30, 2004, 0:43

Comment by ssp: User icon

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…)

September 30, 2004, 15:00

Add your comment

« Bread, Milk, DrugsMainSmart People »

Comments on




This page

Out & About

pinboard Links