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? Link to comment https://forums.phpfreaks.com/topic/194165-gettings-pics-in-a-white-box/ 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. Link to comment https://forums.phpfreaks.com/topic/194165-gettings-pics-in-a-white-box/#findComment-1021744 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.? Link to comment https://forums.phpfreaks.com/topic/194165-gettings-pics-in-a-white-box/#findComment-1023859 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?'. Link to comment https://forums.phpfreaks.com/topic/194165-gettings-pics-in-a-white-box/#findComment-1023984 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? Link to comment https://forums.phpfreaks.com/topic/194165-gettings-pics-in-a-white-box/#findComment-1026981 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 Link to comment https://forums.phpfreaks.com/topic/194165-gettings-pics-in-a-white-box/#findComment-1027030 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.