Reputation: 6354
Given the following code:
HTML:
<input id="myButton" type="button" value="Click me" />
CSS:
#myButton{
text-decoration: underline;
padding: 10px;
}
You can see this as live example on jsfiddle.
I want to achieve that the text inside the button is underlined. It works fine in IE9, Chrome 21, Firefox 14 and Safari 5.1.5, but it is not working in current Opera 12.
I tried the suggestions from this question, but still no underlined text inside the button in Opera. How can I achieve this in that browser?
EDIT:
I want to use a CSS-only solution. I have a lot of forms, some of them are generated by Javascript, so it would be too much effort to change the HTML/Javascript of all these just to fix this one problem on Opera.
Upvotes: 2
Views: 1987
Reputation: 1981
you cannot apply text-decoration and line-through to an input type="button" under xhtml strict. It works under html 4.01 transitional, but not xhtml strict.
Upvotes: 0
Reputation: 41
You can try this:
<button id="test"><span>Test</span></button>
With the following CSS-Styles:
#test{ padding: 10px; }
#test span{ text-decoration: underline; }
Works for me in the newest Opera.
Regards Sören
Upvotes: 1