PDA

View Full Version : How to center a photo ?


scm22ri
11-24-2007, 04:33 AM
Hi Everyone,


I'm trying to figure out how to center my photos using visual studio 05 express edition. I think I'm doing it correctly, I'm right clikcing on the photo pressing "style" then "Text" horizontal = Center Vertical = Middle. The photo in Visual Web Developer centers but when I publish the site, it stays to the right ? Would you anyone know why this is happening ?


Below I've added some of my source code. Any help would be greatly appreciated. Thanks everyone.


http://loverportal.com/APracticePage2.aspx

wisemx
11-24-2007, 05:04 AM
An easy way is to use a DIV tag and a Panel.
Actually using a Panel for ASP.NET is always a good idea, they work very well with everything.



[quote]

<div style="text-align: center">
<asp:Panel ID="Panel1" Enabled="true" ForeColor="DarkOrange" runat="server">
[b][b]
<asp:Image AlternateText="Centered Image" BorderStyle="None" ToolTip="Example of Centered Image"
ID="TitleImage" ImageUrl="~/MyImages/Centered.jpg" runat="server" /></asp:Panel>
</div></CODE>

wisemx
11-25-2007, 01:11 AM
Anyplace after the form tag.
If you're using Master pages, anywhere after the content tag.

scm22ri
11-25-2007, 01:25 AM
Hi,


Thanks for the reply. Do I need to insert this code into my page? If so, where ?


Thanks