一个ASP中环绕文字:按钮 [英] Wrap text within a asp:Button

查看:108
本文介绍了一个ASP中环绕文字:按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是用一个LinkBut​​ton,它没有像它大量的文字这使得它很长。这是细如LinkBut​​ton的包裹文本到下一行,当它跑出房间。

I was using a LinkButton and it had like lot of text in it which made it quite long. This was fine as the LinkButton wrapped the text onto the next line when it ran out of room.

然后我改变了这个为标准的asp:按钮和问题是文本不换行的按钮,只要刚刚变为文本。这是一个问题,因为它迫使容器是内长于我的本意。

I then changed this to a standard asp:Button and the problem is the text doesn't wrap the button just becomes as long as the text. This is a problem because it forces the container it is within to be longer than I intended.

有没有一种方法,使按钮的文本换行?

Is there a way to make the text of the button wrap?

推荐答案

您可以做到这一点通过设置宽度和CSS属性空白:正常

You can do that by setting a width and the CSS property white-space: normal:

这正好在你的< HEAD>

<style type="text/css">
    .wrap { white-space: normal; width: 100px; }
</style>

和您的按钮:

<asp:Button ID="btn" runat="server" Text="some really breally long text that I want to wrap" CssClass="wrap" />

这篇关于一个ASP中环绕文字:按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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