Page 1 of 1

Using an image as a background for a button & linking bu

Posted: Mon Dec 04, 2006 8:18 pm
by Mythic Fr0st
Using an image as a background for a button, how would I do this?

also, how would I link a button to a url

<input type='button' onclick='?'>

Posted: Mon Dec 04, 2006 8:32 pm
by Zoxive

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
input{
background-image:url(../home/imgs/bg.gif);
}
</style>
</head>

<body>
<input type="button" onclick="document.location='http://www.google.com'" value="Google" />
</body>
</html>

Before You Ask

Before asking a technical question by e-mail, or in a newsgroup, or on a website chat board, do the following:

1. Try to find an answer by searching the archives of the forum you plan to post to.
2. Try to find an answer by searching the Web.
3. Try to find an answer by reading the manual.
4. Try to find an answer by reading a FAQ.
5. Try to find an answer by inspection or experimentation.
6. Try to find an answer by asking a skilled friend.
7. If you're a programmer, try to find an answer by reading the source code.

hmm

Posted: Tue Dec 05, 2006 1:12 am
by Mythic Fr0st
I cant get it to work?

I tried URL from my local host apache server, and the name of it with it in the directory, and the location of it\name of it, and the location of it, im not sure how to get it working???

It does change the button, just it goes like a different kind of button, ( Not mine though )

hmm?

Code: Select all

<style type='text/css'>
body
{
background-image:
url('SilverBG.jpg')
}
input{
background-image:url(..http://localhost/Mythic%20Aeons/BlackButton.gif);
} 
</style>
help please

Re: hmm

Posted: Tue Dec 05, 2006 7:20 am
by ddragas
Mythic Fr0st wrote:I cant get it to work?

I tried URL from my local host apache server, and the name of it with it in the directory, and the location of it\name of it, and the location of it, im not sure how to get it working???

It does change the button, just it goes like a different kind of button, ( Not mine though )

hmm?

Code: Select all

<style type='text/css'>
body
{
background-image:
url('SilverBG.jpg')
}
input{
background-image:url(..http://localhost/Mythic%20Aeons/BlackButton.gif);
} 
</style>
help please

try using

Code: Select all

background-image:url(BlackButton.gif);