按钮和文本框不在线 [英] Button and Textbox Not Inline

查看:120
本文介绍了按钮和文本框不在线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下的code

        <div class="well sidebar-nav">
        <ul class="nav nav-list">
            <li class="nav-header-myLeagues">Create A New League</li>
            <li class="divider"></li>
            <li class="li-myLeagues">
                <asp:Label ID="LeagueNameLabel" runat="server">League Name:</asp:Label></li>
            <li class="li-myLeagues">
                <asp:TextBox ID="LeagueNameTextBox" runat="server"></asp:TextBox>
                <asp:Button ID="SubmitNewLeagueButton" CssClass="btn btn-primary" runat="server" CommandName="SubmitNewLeague" Text="Submit" />
            </li>
        </ul>
    </div>

由于某些原因,按钮不完全符合的文本框中行,任何想法如何做到这一点?

For some reason the button is not completely in line with the text box, any ideas how to do so?

推荐答案

包装中的文本框和按钮&LT; D​​IV&GT;&LT; / DIV&GT; ,并设置CSS的float:左div的

wrap the textbox and button in <div></div> and set css float:left to div's

<li class="li-myLeagues">
    <div style="float:left">
        <asp:TextBox ID="LeagueNameTextBox" runat="server"></asp:TextBox></div>
    <div style="float:left;margin-left:10px;">
            <asp:Button ID="SubmitNewLeagueButton" CssClass="btn btn-primary" runat="server" CommandName="SubmitNewLeague" Text="Submit" />
</div>        
</li>

添加CSS类。李-myLeagues

.li-myLeagues
{
display:inline-block;
float:left;
}

这篇关于按钮和文本框不在线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆