PDA

View Full Version : [SOLVED]Can I center an image in a panel?



StevenInc
5 Aug 2009, 2:18 PM
This is a very simple panel that is stacked in a vbox with other panels.
This is the only panel I would like to center the content in.

Thanks


var topPanoramicImage = {
xtype: 'panel',
height: 70,
bodyStyle:{"background-color":"#D1DFF0"},
html: '<img src="assets/images/ihome/panoramic_MiamiFl2.png" alt="panoramic image" width="770" height="70" border="0">'
};

chesstrix
5 Aug 2009, 2:48 PM
It depends exactly how you want the center to work but simply wrapping the img tag in a <center> tag will do it.



html: '<center><img src="assets/images/ihome/panoramic_MiamiFl2.png" alt="panoramic image" width="770" height="70" border="0"></center>'


If you have more than just this image to center then this might help


bodyStyle:{"background-color":"#D1DFF0"; text-align: center;}


I'm surprised that you need a whole panel to hold just an image though (:|

StevenInc
10 Aug 2009, 7:18 PM
Thank you - That solved it.