Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button underlining in FF with DOCTYPE

Status
Not open for further replies.
Dec 8, 2003
17,047
GB
In Firefox (v1.0.4, although I have no idea about any other versions), the following code works fine, and underlines the button:

Code:
<html lang="en">
<head>
	<style type="text/css">
		.underlined {
			text-decoration: underline;
		}
	</style>
</head>
<body>
	<input type="button" value="A button" class="underlined" />
</body>
</html>

However, when I add in the DOCTYPE we are using to the top of the page:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]

The underline dissapears.

I've searched around on Google, and can find no reference to this quirk. The underline still works fine in IE 5, 5.5, 6, and even NN 7.0... but just vanishes on FF.

Does anyone have any idea why this is, or how to get it back while keeping that specific DOCTYPE?

Thanks!
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Yet text-decoration:blink works fine!

I'll bet you don't want to go here, but how about:

Code:
<button value="A button" class="underlined"><u>A button</u></button>

Good luck! I can't find anything by Googling either.

--Dave
 
I'd be game for giving the -moz extensions ago, but that would pose a problem in this case.

The client is not officially supporting Firefox (I know, I know... very bad decision... and believe me, I've made my feelings known on this one), so if any -moz extensions crop up in the CSS, they'll probably get quite upset at having CSS validation errors for a browser they're not supporting.

Having said that, I'm going out of my way to make sure everything does work the same in FF, and this is the only thing I've found so far that doesn't... so it would be nice to have the underline functionality working (the buttons are styled to look like regular text links).

Anyway - I'll keep trying Google... I can't be the only person to have come across this need.

Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Dave - thanks for the "button" idea... but due to the scale of the sites in question (20 or so brands with 10 products, each with their own fully-blown e-commerce solution), I'd have to get the JSP bods to make a lot of changes. While normally this wouldn't be a problem, I can't justify this due to us not officially supporting Firefox (again, not my choice). Ideally I'd really like a CSS fix that I can slot in... even JS is out of the question.

Anyway - will keep trying!

Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top