CSS Button Style Links

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
Parody
Forum Contributor
Posts: 252
Joined: Fri May 06, 2005 7:06 pm
Location: Great Britain

CSS Button Style Links

Post 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 :(
User avatar
wwwapu
Forum Contributor
Posts: 197
Joined: Wed Apr 07, 2004 11:57 am
Location: Turku, Finland

Post 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.
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

You can use javascript:

Code: Select all

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