• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 307
  • Last Modified:

How can I get the image to position center, horizontally, on top of the form?

Hi, I'm using asp.net 3.5
how can I position this img to appear center, before the table below it.  Inside of the form, thank you
<body>
    <div align="left" style="width:880px; border-style: solid; border-width: medium; padding: 20px 20px 2in 20px; margin: 0in 2in 0in 2in; background-color: #FFFFFF;">
    <form id="frmManageAccounts" runat="server" style="background-image: url('../../Images/adapt_bg.jpg'); background-repeat: repeat">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <img id="logo" alt="Adapt Logo" src="../images/AdaptLogo.jpg" />
    <table id="tblNewAccount"  width="880px">
        <tbody>
            <tr>

Open in new window

0
lapucca
Asked:
lapucca
1 Solution
 
maosalahCommented:
try

  margin-left: auto;
  margin-right: auto;
0
 
Gurvinder Pal SinghCommented:
if the size of the image is supposed to be fixed then (since the parent div has a fixed size 880px)

img
{
   width:60%;
   margin-left:20%;
}

idea is to give a width to the image and then depending upon the width give the appropriate left margin to it, so that width + 2 (left margin) = 100%

0
 
elliottbenzleCommented:
try adding the code below to your image

 <div align="left" style="width:880px; border-style: solid; border-width: medium; padding: 20px 20px 2in 20px; margin: 0in 2in 0in 2in; background-color: #FFFFFF;">
    <form id="frmManageAccounts" runat="server" style="background-image: url('../../Images/adapt_bg.jpg'); background-repeat: repeat">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <img id="logo" alt="Adapt Logo" src="../images/AdaptLogo.jpg" style="margin-left:auto; margin-right:auto;" />
    <table id="tblNewAccount"  width="880px">
        <tbody>
            <tr>
0
 
lapuccaAuthor Commented:
Thanks everyone.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now