How to wrap Text in a button?

This is a discussion on "How to wrap Text in a button?" within the Web Page Design section. This forum, and the thread "How to wrap Text in a button? are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Oct 27th, 2007, 15:55
New Member
Join Date: Oct 2007
Location: Egypt
Age: 25
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
How to wrap Text in a button?

Hi,

I need to wrap the text of button so that it fits in the button's fixed width and doesn't expand the button's width, only it's height.

This can be done in a regular text using the WORD-BREAK:BREAK-ALL; attribute
But I tried this on the button and it's not working?

Is there any work around for that? any css attribute?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Oct 27th, 2007, 16:25
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to wrap Text in a button?

Is the button a normal input (<input type=button>)? If not, could you tell us what it is?
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Oct 28th, 2007, 05:56
New Member
Join Date: Oct 2007
Location: Egypt
Age: 25
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to wrap Text in a button?

Yes it's a normal submit button

<input type=button value="ssssssssssssssssss">

and I have the button size like 10px for instance. I don't want the button to expand, I need to wrap the button's value to fit into the button's specified width
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Oct 28th, 2007, 13:30
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to wrap Text in a button?

If you want to write endless text without the width changing, you need to use css. Try this:
Code: Select all
.mybutton {
width: 10px;
}


<input type="button" class="mybutton" value="abc...">
If that does not work, I have another idea.
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Oct 29th, 2007, 06:06
New Member
Join Date: Oct 2007
Location: Egypt
Age: 25
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to wrap Text in a button?

It doesn't work cause when you specify a width, the rest of the word won't appear

like if u have a value of 'ssssssssssssssssss' and your button's width is like 3px , only the first 3 characters will appear.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Oct 29th, 2007, 06:13
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: How to wrap Text in a button?

So don't specify the button width! Let the button width determined by the button value..
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Oct 29th, 2007, 06:45
New Member
Join Date: Oct 2007
Location: Egypt
Age: 25
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to wrap Text in a button?

Hi,
The problem is that I need the button to be of fixed size and wrap the text inside it, so that it doesn't expand as it'll affect my page's layout
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Oct 29th, 2007, 06:58
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: How to wrap Text in a button?

Quote:
Originally Posted by natoskiii View Post
It doesn't work cause when you specify a width, the rest of the word won't appear

like if u have a value of 'ssssssssssssssssss' and your button's width is like 3px , only the first 3 characters will appear.
What actually do you want your button to be?
Of course if your button value is "ssssssssssssssssss", the button sure will be wider!

But you want all of them to appear in your button tho...
If you want a fixed width button, set the width as mention by swagner, and adjust your button value or,
change your button onto an image button.
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)

Last edited by Monie; Oct 29th, 2007 at 07:06.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Oct 29th, 2007, 08:53
Up'n'Coming Member
Join Date: Jun 2007
Location: Germany
Age: 23
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to wrap Text in a button?

You say you have an <input type="button"> .. so it is actually a normal button.
So try this alternative
HTML: Select all
<button style="width:100px; height:100px;">I am a<br>wrapped text</button>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Oct 29th, 2007, 21:43
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to wrap Text in a button?

Yup, that is what I would have suggested next. Just use
HTML: Select all
<button>Text<br>Text</button>
Lucleonhart also mentioned using style="" to format the width, but you can also use the css styling I suggested in my previous post.
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Nov 1st, 2007, 00:33
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to wrap Text in a button?

Please mark this thread as solved via thread tools at the top. Thanks
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to text wrap? Quetzal Web Page Design 9 Jun 3rd, 2008 18:58
button text picture change R8515198 JavaScript Forum 7 Feb 11th, 2008 12:36
Picture wrap around text? (more info inside) KOinMotion Web Page Design 1 Nov 13th, 2006 09:59
How to wrap text around a div AdRock Web Page Design 6 Sep 5th, 2006 19:02
Text wrap - widening space gribble Web Page Design 1 Aug 17th, 2005 03:38


All times are GMT. The time now is 11:20.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42