- 1). Open your program. In this example we will be using Microsoft Paint, although you can use any image editing program you prefer, such as Photoshop. In Windows 7, click the Start button, type "Paint," and hit Enter.
- 2). Design your button. In the Image section under the Home tab, click Re-size and select the Pixels radio button. Making sure the "Maintain Aspect Ratio" box is unchecked, enter your desired button size in the Horizontal and Vertical boxes and click OK. Use the tools within the program along with your own creativity to create your button.
- 3). Finish and save your file. Use the blue button on the top-left of the window to bring down the menu and choose Properties. Select the Pixels radio button and change the height to exactly twice the current size and click OK. You're now creating the rollover image directly below your original button. Once you are finished, click the floppy disk on the very top of the program window and save your file, using PNG format in Paint to avoid color distortion. Upload this image file to your web server or image hosting site.
- 4). Add the following code to your webpage within the <HEAD> tag:
<style type="text/css">
#button {
display: block;
width: ###px;
height: @@px;
background: URL("button.gif") no-repeat 0 0;
}
#button:hover {
background-position: 0 -@@px;
}
#button span {
position: absolute;
top: -999em;
}
</style>
Replace all hash signs (#) with the width of the button, and all at symbols (@) with the height of the button (before you doubled it). Replace button.gif with the full URL to your image. - 5). Add the following code in your <BODY> tag where you would like the button to appear:
<a href="/links/?u=URL" title="Button"><span>Button Text</span></a>
Replace "URL" with the URL to the page the button is linking to. - 6). Test your new button on your website. If you are using the button for navigational purposes, you may want to make several more!
SHARE