Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

style of a button

 
JayaSiji Gopal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to know if it is possible to underline the text of a button?
How can I do it? Is it also possible to left align the text of a button?

<code>
<input type='button' value='Test'/>

</code>

The value = Test should be underlined and left aligned.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried to use CSS?

Eric
 
JayaSiji Gopal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I am using CSS to style the button. However, I am unable to find code snippet, which would allow me to underline the text and also, left align the text of a button?

Any help or links, please assist!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by JayaSiji Gopal:
Yes, I am using CSS to style the button!


That's important information that you should have included in your first post. Otherwise, it makes it sound like you don't know about CSS at all.

I have found that most browsers ignore many CSS rules, such as underline, for input buttons. Some browsers support more rules for the <button> control, but the support is still spotty. For example, Safari will undeline the text of a <button> but Firefox will not.
 
JayaSiji Gopal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, the application would be used by users in IE6 and IE7. Could anybody please help me find the code snippet to style the button text?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I fired up Parallels so I could run XP and check it out in IE 7.

IE 7 appears to honor the normal CSS rules without issue for both <input type="button"> and <button>. You'll have to test IE 6 on your own.
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IE 6 seems to be fine as well -



Regards,
Dan
[ June 04, 2007: Message edited by: Bear Bibeault ]
 
JayaSiji Gopal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dan,

Would you also know the code snippet to left align the text of a button?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basic CSS: text-align: left

You should be sure to have a CSS reference handy.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic