我得到了一个ASP.net应用程序,但是我需要一些html和css方面的帮助。所以我得到了一些文本,然后是一些按钮和一些文本,现在我希望所有这些按钮跳转到下一行,当一个元素从页面中掉出来时。
<p> Lorum ipsum ...
<asp:Button ID="Button1" allotherrequiredatts=""/>
<asp:Button ID="Button2" allotherrequiredatts=""/>
<asp:Button ID="Button3" allotherrequiredatts=""/>
more text </p>

我通过在代码中添加一个<br>标记来操作最后一个结果。
因此,是否有一个好的CSS或HTML技巧,使这成为可能。
发布于 2014-10-28 13:32:53
空域现在应该这样做:
<p> Lorum ipsum ...
<span style="white-space: nowrap;">
<asp:Button ID="Button1" allotherrequiredatts=""/>
<asp:Button ID="Button2" allotherrequiredatts=""/>
<asp:Button ID="Button3" allotherrequiredatts=""/>
</span>
more text </p>发布于 2014-10-28 13:32:19
将按钮包装在<span>中,并将span的CSS设置为display: block;。
这将防止span (您的按钮)的内容包装到新行。
发布于 2014-10-28 13:33:21
把这5个按钮扔到一个面板元素里,就像.
<asp:panel style="float:left;">
<asp:Button ID="Button1" allotherrequiredatts=""/>
<asp:Button ID="Button2" allotherrequiredatts=""/>
<asp:Button ID="Button3" allotherrequiredatts=""/>
</asp:panel>https://stackoverflow.com/questions/26609576
复制相似问题