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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Mythic Fr0st
Forum Contributor
Posts: 137
Joined: Sat Dec 02, 2006 3:23 am
Contact:

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

Post 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='?'>
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Post 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.
Mythic Fr0st
Forum Contributor
Posts: 137
Joined: Sat Dec 02, 2006 3:23 am
Contact:

hmm

Post 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
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Re: hmm

Post 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);
Post Reply