Link to home
Start Free TrialLog in
Avatar of HyperBPP
HyperBPP

asked on

Getting text in html button to wrap

I  am using CSS to define the height and width of some buttons on my page.  However, the text inside the button will not wrap and gets clipped unless I set the overflow to visible; in which case it oversizes the button to accomadate the text.  How do I get the text to wrap inside the button

<button class="largebutton">My text that overflows</button>
Avatar of Zyloch
Zyloch
Flag of United States of America image

I am not sure if this will work, but you can try this CSS style: word-wrap: break-word
Greets,

considering that the <button> tag will let you put html inside it... try

<button><span style="width:10px;display:block;">some text</span><button>

Regards
Steggs
ASKER CERTIFIED SOLUTION
Avatar of VirusMinus
VirusMinus
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of HyperBPP
HyperBPP

ASKER

The <br> will probably work for me though a bit of pain.  

How about in the case of an <input type="submit" name="aButton" class="sizedbutton" value="#someCFvalue#">?
same  deal with the inputs
if you have a server side language like CF, ASP or php, you could do character counts before you write out the button text and insert in <br>'s
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial