Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Centering variable-width images 1

Status
Not open for further replies.

johnwm

Programmer
Feb 7, 2001
8,469
GB
Is it possible using standards-compliant markup to centre an image in a div, when you don't know what the image width will be? I've checked FAQs, and googled for 'centre variable width images' without much success, except for a rather hacky conditional version at Have a look at - I'm trying to get the images centred in their floated divs, but the image widths will vary between around 115 and 150 px. The whole lot is db driven and the client will be uploading his own images, and the upload routine just resizes the image to give a max dimension of 150px. Sorry it's a slow loader at present (some button images missing)

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Problem now resolved.

Thank you very much. As a rather old UK guy I'm only slowly training my brain to spell 'centre' incorrectly as 'center' [smile]

All I need to do now is sort the few IE6 bits!

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top