5

First See the image given below.

enter image description here

code here:

    <h5>
        Login!</h5>
    <table>
        <tr>
            <td>
                User Name:
            </td>
            <td>
                <asp:TextBox ID="_userName" runat="server"></asp:TextBox>
            </td>
            <td>
                Password:
            </td>
            <td>
                <asp:TextBox ID="_password" TextMode="Password" runat="server"></asp:TextBox>
            </td>
            <td>
                <asp:Button ID="_login" runat="server" Text="Login" OnClick="_login_Click" />
            </td>
        </tr>
        <tr>
            <td colspan="5">
                <asp:Label ID="_wrongDetails" runat="server"></asp:Label>
            </td>
        </tr>
    </table>

I want username immediately after login text. I have tried position:inline. but it's not working. or can anyone help me to get started in css stuff. Thanks in Advance.

4

2 回答 2

6

You need to set display:inline style in both h5 tag and table tag also. Then it will not cause both tag to break a line and hence display it in a single line.

fix it:

    <h5 style="display:inline">
    Login!</h5>
<table style="display:inline">
..
..

hope this helps you.

于 2012-10-12T10:47:24.843 回答
2

Set the <h5> to be display: inline or display: inline-block.

That would cause it not to break the line.

You may want to use a <form> for the login form instead of a <table>.

于 2012-10-12T10:05:11.580 回答