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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ModalPopup not centered

Status
Not open for further replies.

pinkpoppy

Programmer
Jul 6, 2011
75
US
Hello, I have been having this issue for over a week and I am about to pull my hair out. It is not centering for me. Here's what I have right now for the css (I've searched for solutions and tried just about every one of them available on the internet, this is what I have so far for it.)

Code:
        div.ModalPopup2
    {

        font-family: Verdana, Arial, Helvetica, sans-serif;
        font-size: 15px;
        font-style: normal;
        background-color: #544d3d;
        position: fixed; /* set z-index higher than possible */
        z-index: 10000;
        color: Black;
        border-style: solid;
        border-color: #999999;
        border-width: 1px;
        top: 50%;
        left: 50%;
        width: auto;
        height: auto;
        margin-top: -9em;
        margin-left: -23em;
    }


And this is how is it used. The popup is off to the left.

Code:
                      <div id="divLogout" align="center" class="ModalPopup2" runat="server" style="display: none;">
                         <table style="background-color: #F6F3EE; border: solid 2px #000000;" cellpadding="2" cellspacing="2">
                               <tr>
                              <td align="center">
                                 <span style="color: Red; font-weight: bold;">
                              Are you sure you want to log out?<br />
                               Your data will not be saved.</span>
                                            </td>
                                            </tr> 
                                            <td align="center">
                                                <asp:Button ID="btnYes" UseSubmitBehavior="false" CssClass="button" runat="server" CausesValidation="false"
                                                    Text="Yes" OnClick="btnYes_Click" Height ="30px" Width= "85px" />
                                                <asp:Button ID="btnNo" UseSubmitBehavior="false" CssClass="button" runat="server" CausesValidation="false"
                                                    Text="No" OnClick="btnNo_Click" Height ="30px" Width= "85px"/>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                &nbsp;
                                            </td>
                                        </tr>
                                    </table>
                                </div>


Any help and suggestions is greatly appreciated! :)
 
This is not an ASP.NET question. You'd be better off posting here:
forum215

However, I believe you need to use margin: 0 auto;
 
Thanks! I tried using margin: 0 auto and that does not work either.

I will post in the other forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top