Wrap Text in Button

A

Alphonse Giambrone

Is there any way to wrap the text for an asp.net button?
In other words if the text for a button consists of two words, increase the
button height and reduce the width so the 2 words appear one above the other
(2 lines).

TIA
 
S

Steven Cheng[MSFT]

Hi Alphonse,

Thanks for posting in the community!
From your description, you'd like to make the text of the html button on
the web page auto wrap when there are multi words in it and the width is
not enought, yes?

After some researching , I found that it seems a existing limitation of the
html buttons that the normal word-wrap css style not works on them.
There're three kinds of button in html page:
<input type=submit ..>
<input type=button ..>
<button >

the ASP.NET server button is usually mapped to the <input type=submit>
So if we use the above two kinds of button, we may meet the limitation of
wrapping the button's text.
However, I've found some one use the below styles of button which can
contains a text block(which has been set the word-wrap style).
------------------------------
<BUTTON id="btnWrap" type="button" runat="server">
<div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM:
0px; MARGIN: 0px; WIDTH: 70px; PADDING-TOP: 0px; HEIGHT: 48px; WORD-WRAP:
break-word"
width="100%">this is a casfdsfdsfsdfsdfsfsdfdsfsft</div>
</BUTTON>
------------------------------

So do you think it possbile that we use the above means to workaround this
problem? Please have a check and feel free to let me know if you have any
other ideas. Thanks.



Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Top