therealwesfoster Posted July 7, 2009 Share Posted July 7, 2009 Let's say I want to have an HTML button have 2 lines of text, for example (neither of the following codes work. they are just examples of what I need to do): <input type="submit" name="button" value="Line1\nLine2" /> <input type="submit" name="button" value="Line1 Line2" /> How can I achieve this? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 7, 2009 Share Posted July 7, 2009 this works for me: <input type="submit" name="submit" value="Line1 Line2" /> you can also use CSS to add a fixed width and then add "white-space:normal" Quote Link to comment Share on other sites More sharing options...
therealwesfoster Posted July 7, 2009 Author Share Posted July 7, 2009 I'll try the css trick and see what happens. But the code that works for you, doesn't work for me in FF Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 7, 2009 Share Posted July 7, 2009 the CSS way is: <input type="submit" name="submit" style="width:5em;white-space:normal;" value="Line1 Line2" /> Quote Link to comment Share on other sites More sharing options...
therealwesfoster Posted July 7, 2009 Author Share Posted July 7, 2009 The CSS trick worked, although ugly as a goat (because I had to do a lot of ). Any insight on change font sizes or colors while INSIDE of a button? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 8, 2009 Share Posted July 8, 2009 what was i thinking...just use a button instead: <button type="submit">Line 1<br />Line 2</button> Quote Link to comment Share on other sites More sharing options...
haku Posted July 8, 2009 Share Posted July 8, 2009 value="line 1<br/>line2" has worked for me in the past I think. Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 8, 2009 Share Posted July 8, 2009 value="line 1<br/>line2" has worked for me in the past I think. nah...value doesn't support HTML edit: in fact, i don't think any dom attribute renders html in it's value Quote Link to comment Share on other sites More sharing options...
therealwesfoster Posted July 8, 2009 Author Share Posted July 8, 2009 what was i thinking...just use a button instead: <button type="submit">Line 1<br />Line 2</button> Nice I don't think I've ever used the button tag. As for your latest reply, I don't think they do either. Thanks bro Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.