justinchrono Posted March 4, 2010 Share Posted March 4, 2010 hello. i have many thumbnails on my site..they are different sizes...but all similar. i want to have a white box that is around all of the thumbnails, so that they r all in the same size box and aligned. anyone know how i can do this? Quote Link to comment Share on other sites More sharing options...
haku Posted March 5, 2010 Share Posted March 5, 2010 First you put each image in a div, set the background of the div to white, and give it a standard width and height. Then you can do one of the following: 1) Use a server-side script to resize your thumbnails to a standard size 2) Use a server-side script to get the dimensions of the images, then use a bit of calculations to set inline CSS for a top margin that will center the thumbnail, using auto side margins to center it horizontally 3) You can use javascript to do #2 (though I wouldn't recommend it). This is all dependent on your images being smaller than the size of the standard div you give at the start. Quote Link to comment Share on other sites More sharing options...
justinchrono Posted March 9, 2010 Author Share Posted March 9, 2010 what if i could make them all fit in a 130 by 130 pixel box? and then if i can just either auto center it horizontally/vertically or move it to one side, etc.? Quote Link to comment Share on other sites More sharing options...
haku Posted March 10, 2010 Share Posted March 10, 2010 I'm not sure what you are asking there. 'What if' isn't really a question that's easy to answer. The only real answer to 'what if I ...?' is 'what if you did?'. Quote Link to comment Share on other sites More sharing options...
justinchrono Posted March 16, 2010 Author Share Posted March 16, 2010 ok, how do i write that server side code ur talking about? Quote Link to comment Share on other sites More sharing options...
haku Posted March 16, 2010 Share Posted March 16, 2010 http://articles.sitepoint.com/article/image-resizing-php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.