textbox height different than input height

Discussion in 'ASP .Net' started by tshad, Mar 8, 2007.

  1. tshad

    tshad Guest

    I have 2 objects - one an aspx textbox object and one an html Input object:

    <asp:TextBox ID="UserName" CssClass="top-links" style="height:10px"
    Columns="12" runat="server"/>

    <input name="textfield222" type="text" class="top-links" size="12"
    height="10px" />

    The heights are different, however. Why would that be?

    The TextBox height appears about 2/3 the size of the Input object even
    though both have ha height of 10px.

    Why does the style work differently?


    tshad, Mar 8, 2007
    1. Advertisements

  2. tshad

    bruce barker Guest

    <input> does not have a height property, so its ignored. you need to use
    a style command:

    <input name="textfield222" type="text" class="top-links" size="12"
    style="height:10px;" />

    -- bruce (sqlwork.com)
    bruce barker, Mar 8, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.