ClickStart logo CSS to the point

Adding a background image to a button

You can use the background property to add a background image to a button.

Screenshot

Code

In this example, the image is 30px by 30px, so 34px of left padding is included to prevent the label from overlapping the image. The button has also been sized to 34px so the image will fit inside the button.

button {
background: url(email.png) left center no-repeat;
padding-left: 34px;
height: 34px;
}

Example

Click here to see an example.