Inline horizontal spacer in HTML

Posted by LeafStorm on Stack Overflow See other posts from Stack Overflow or by LeafStorm
Published on 2010-06-03T16:54:12Z Indexed on 2010/06/03 17:44 UTC
Read the original article Hit count: 149

Filed under:

I am making a Web page with a slideshow, using the same technique used on http://zine.pocoo.org/. The person I'm making the site for wants the slideshow to be centered. However, some of the photos are portrait layout and some are landscape. (This was not my choice.) I need a position: absolute to get the li's containing the items in the right place, so centering them does not work. (At least, not by normal methods.)

So, I thought that it might work to insert a 124-pixel "spacer" before the image on the portrait pictures. I tried it with a <span style="width: 124px;">&nbsp;</span>, but it only inserts a single space, not the full 124 pixels. The slideshow fades in and out OK, though, so I think that it would work if I could get the proper spacing.

My question is this: does anyone know a way to have 124px of space inline in HTML (preferably without using images), or another way to center the pictures in the li items?

© Stack Overflow or respective owner

Related posts about html