Page 1 of 1

CSS Button Style Links

Posted: Sat Jun 18, 2005 12:50 am
by Parody
I have an external stylesheet, with this in:

Code: Select all

input.btn{
	border-width:2;
	border-style:solid;
	background-color:darkred;
	color:AliceBlue;
	border-color:White;
	Font-family:&quote;Verdana&quote;;
	font-size:10pt;
	cursor:hand;
	height:24px;
	}
And in my html page, I have this:

Code: Select all

<input type=&quote;button&quote; value=&quote;Do this crime&quote; class=&quote;btn&quote; href=&quote;www.imageshack.us&quote;>
My question is, how do I turn the button into a link?
I tried using the <href> tags around the whole line, but that gets a massive chunky border around the button, and the link didnt work :(

Posted: Sat Jun 18, 2005 2:12 am
by wwwapu
You might want to look at http://www.w3.org/TR/html4/interact/for ... ush-button

Code: Select all

<a href=&quote;http://www.somewhere.com&quote;><BUTTON name=&quote;submit&quote; value=&quote;submit&quote; type=&quote;button&quote;>
    Send<IMG src=&quote;/icons/wow.gif&quote; alt=&quote;wow&quote;></BUTTON></a>
Works with Opera and Firefox, but not with IE.

You should also check your css. I don't recall darkred or Aliceblue being valid colornames.

Posted: Sat Jun 18, 2005 3:03 am
by nigma
You can use javascript:

Code: Select all

<input type=&quote;button&quote; onclick=&quote;window.location='www.google.com'&quote; />