.tool-btn {
background: url("myfile.png");
display: inline-block;
height: 20px;
width: 20px;
}Implementing image sprites in CSS / notebook
Implementing image sprites in CSS
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
#btn1 {
background-position: -20px 0px;
}
#btn2 {
background-position: -40px 0px;
}