I use three shots of a button on an image to give impression of a button in action.
Normal / Hover / Active.
Here is an image of that:
The CSS code for picking the right image for the right state is here:
#btnSet1 {
position: absolute;
left: 200px;
top: 100px;
}
.btn1 a {
padding: 0px;
text-decoration: none;
opacity: 0.7;
}
.btn1 a.link1 p {
position: relative;
text-align: center;
left: -10px;
top: 20px;
color: white;
font-family: sans-serif;
text-decoration: none;
text-shadow: 5px 5px 5px #111;
opacity: 1;
}
.btn1 a.link1:link {
display: block;
height: 90px;
width: 144px;
background: url(../images/btn3.png) no-repeat 0 0;
}
.btn1 a.link1:hover {
display: block;
height: 90px;
width: 144px;
background: url(../images/btn3.png) no-repeat 0px -90px;
}
.btn1 a.link1:active {
display: block;
height: 90px;
width: 144px;
background: url(../images/btn3.png) no-repeat 0px -180px;
}
.btn1 a.link1:visited {
display: block;
height: 90px;
width: 144px;
background: url(../images/btn3.png) no-repeat 0px -270px;
}
#tHeader {
position: absolute;
top: 100px;
left: 300px;
}
I made these images to be large, because I need to scale them, occasionally. The HTML image element can be used to stretch any image, but I only show a region of the total image with the CSS style. So, for the sake of clarity, let's call each button face being shown a view... so, how can I stretch the view of each button face in code, since the x y refer to unscaled metrics of the image?