![]() |
|
![]() | ||
|
Subject:
Centering thumbnails vertically and horizontally within square divs
Category: Computers > Programming Asked by: carbon-ga List Price: $10.00 |
Posted:
05 Dec 2003 19:56 PST
Expires: 04 Jan 2004 19:56 PST Question ID: 284031 |
![]() | ||
|
There is no answer at this time. |
![]() | ||
|
Subject:
Re: Centering thumbnails vertically and horizontally within square divs
From: littlekosh-ga on 06 Dec 2003 15:20 PST |
Are you talking about something like this? http://www.littlekosh.com/cthumb/index.php If you have any access to a database backend I would recommend that you store the width/height/location information for your thumbnails in there. I haven't bothered really benchmarking this script, but I don't imagine that it performs very well with a lot of images. |
Subject:
Re: Centering thumbnails vertically and horizontally within square divs
From: littlekosh-ga on 06 Dec 2003 15:57 PST |
Stupid me, I just realized you probably wanted pure CSS--no background stuff. Vertical alignment in CSS is notoriously difficult. There are a couple of solutions out there, but neither one of them is capable of doing what you want. The first (http://www.wpdfd.com/editorial/wpd0103.htm#toptip) requires knowledge of height of what you want to center. The other (http://vmalek.murphy.cz/) focuses on making your entire page centered, and so it plays with the size of the centered element (an image in your case, so no good). Sorry I can't be of more help. |
Subject:
Re: Centering thumbnails vertically and horizontally within square divs
From: carbon-ga on 06 Dec 2003 16:27 PST |
I appreciate your efforts. |
Subject:
Re: Centering thumbnails vertically and horizontally within square divs
From: websmith-ga on 18 Mar 2004 19:25 PST |
Since you're talking about using IE to display the images, and CSS doesn't work terribly well, did you try to vertically align your image within your <p> with <img align=absmiddle ...>. Don't know if this is much help, especially since this thread has expired. |
Subject:
Re: Centering thumbnails vertically and horizontally within square divs
From: magnus_mellin-ga on 06 Apr 2004 03:49 PDT |
This works as expected in Internet Explorer, Opera and Mozilla. <div id="imageCenteredDiv" style="background-image: url(image.jpg); background-position: center center; border: solid 1px #000000; background-repeat: no-repeat; height: 80; width:80;"></div> |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |