---
title: "实现Extjs多图标背景按钮图标定位"
author: "beyond429"
date: "2013-07-12T14:34:38Z"
tags: []
categories: ["Web前端"]
slug: "extjs"
draft: false
lastmod: "2013-07-12T14:34:38Z"
id: 1904955
url: "https://beyond429.iteye.com/blog/1904955"
---

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;

&lt;head&gt;

    &lt;title&gt;多图标背景按钮图标定位&lt;/title&gt;

    &lt;style type="text/css"&gt;

body

{

 background-color:#eef;

}

 

/* Tools \*/

.x-tool {

border-style: none;

border-width: 0;

    width:15px;

    height:15px;

    cursor:pointer;

background: url('tool-sprites.gif');

}

        

.x-tool-close { 

    background-position:0 -0;

}

 

x-tool-close-over {

    background-position:-15px 0;

}

 

.x-tool-minimize {

    background-position:0 -15px;

}

 

.x-tool-minimize-over {

    background-position:-15px -15px;

}

 

.x-tool-maximize {

    background-position:0 -30px;

}

 

.x-tool-maximize-over {

    background-position:-15px -30px;

}

 

.x-tool-restore {

    background-position:0 -45px;

}

 

.x-tool-restore-over {

    background-position:-15px -45px;

}

 

.x-tool-gear {

    background-position:0 -90px;

}

 

.x-tool-gear-over {

    background-position:-15px -90px;

}

 

.x-tool-prev {

    background-position:0 -105px;

}

 

.x-tool-prev-over {

    background-position:-15px -105px;

}

 

.x-tool-next {

    background-position:0 -120px;

}

 

.x-tool-next-over {

    background-position:-15px -120px;

}

 

.x-tool-pin {

    background-position:0 -135px;

}

 

.x-tool-pin-over {

    background-position:-15px -135px;

}

 

.x-tool-unpin {

    background-position:0 -150px;

}

 

.x-tool-unpin-over {

    background-position:-15px -150px;

}

 

.x-tool-right {

    background-position:0 -165px;

}

 

.x-tool-right-over {

    background-position:-15px -165px;

}

 

.x-tool-left {

    background-position:0 -180px;

}

 

.x-tool-left-over {

    background-position:-15px -180px;

}

 

.x-tool-down {

    background-position:0 -195px;

}

 

.x-tool-down-over {

    background-position:-15px -195px;

}

 

.x-tool-up {

    background-position:0 -210px;

}

 

.x-tool-up-over {

    background-position:-15px -210px;

}

 

.x-tool-refresh {

    background-position:0 -225px;

}

 

.x-tool-refresh-over {

    background-position:-15px -225px;

}

 

.x-tool-plus {

    background-position:0 -240px;

}

 

.x-tool-plus-over {

    background-position:-15px -240px;

}

 

.x-tool-minus {

    background-position:0 -255px;

}

 

.x-tool-minus-over {

    background-position:-15px -255px;

}

 

.x-tool-search {

    background-position:0 -270px;

}

 

.x-tool-search-over {

    background-position:-15px -270px;

}

 

.x-tool-save {

    background-position:0 -285px;

}

 

.x-tool-save-over {

    background-position:-15px -285px;

}

 

.x-tool-help {

    background-position:0 -300px;

}

 

.x-tool-help-over {

    background-position:-15px -300px;

}

 

.x-tool-print {

    background-position:0 -315px;

}

 

.x-tool-print-over {

    background-position:-15px -315px;

}

 

.x-tool-expand {

    background-position:0 -330px;

}

 

.x-tool-expand-over {

    background-position:-15px -330px;

}

 

.x-tool-collapse {

    background-position:0 -345px;

}

 

.x-tool-collapse-over {

    background-position:-15px -345px;

}

 

    &lt;/style&gt;

&lt;/head&gt;

&lt;body&gt;

    &lt;input id="Button1" class="x-tool x-tool-close" type="button" /&gt;

   

    &lt;input id="Button2" class="x-tool x-tool-close-over" type="button" /&gt;&lt;br&gt;

   

    &lt;input id="Button3" class="x-tool x-tool-minimize" type="button" /&gt;

   

    &lt;input id="Button4" class="x-tool x-tool-minimize-over" type="button" /&gt;&lt;br&gt;

 

    &lt;input id="Button1" class="x-tool x-tool-maximize" type="button" /&gt;

   

    &lt;input id="Button2" class="x-tool x-tool-maximize-over" type="button" /&gt;&lt;br&gt;

   

    &lt;input id="Button3" class="x-tool x-tool-restore" type="button" /&gt;

   

    &lt;input id="Button4" class="x-tool x-tool-restore-over" type="button" /&gt;&lt;br&gt;

 

    &lt;input id="Button1" class="x-tool x-tool-gear" type="button" /&gt;

   

    &lt;input id="Button2" class="x-tool x-tool-gear-over" type="button" /&gt;&lt;br&gt;

   

    &lt;input id="Button3" class="x-tool x-tool-prev" type="button" /&gt;

   

    &lt;input id="Button4" class="x-tool x-tool-prev-over" type="button" /&gt;&lt;br&gt;

 

    &lt;input id="Button1" class="x-tool x-tool-next" type="button" /&gt;

   

    &lt;input id="Button2" class="x-tool x-tool-next-over" type="button" /&gt;&lt;br&gt;

   

    &lt;input id="Button3" class="x-tool x-tool-pin" type="button" /&gt;

   

    &lt;input id="Button4" class="x-tool x-tool-pin-over" type="button" /&gt;&lt;br&gt;

 

    &lt;input id="Button1" class="x-tool x-tool-unpin" type="button" /&gt;

   

    &lt;input id="Button2" class="x-tool x-tool-unpin-over" type="button" /&gt;&lt;br&gt;

   

    &lt;input id="Button3" class="x-tool x-tool-right" type="button" /&gt;

   

    &lt;input id="Button4" class="x-tool x-tool-right-over" type="button" /&gt;&lt;br&gt;

 

    &lt;input id="Button1" class="x-tool x-tool-left" type="button" /&gt;

   

    &lt;input id="Button2" class="x-tool x-tool-left-over" type="button" /&gt;&lt;br&gt;

   

    &lt;input id="Button3" class="x-tool x-tool-down" type="button" /&gt;

   

    &lt;input id="Button4" class="x-tool x-tool-down-over" type="button" /&gt;&lt;br&gt;

 

    &lt;input id="Button1" class="x-tool x-tool-up" type="button" /&gt;

   

    &lt;input id="Button2" class="x-tool x-tool-up-over" type="button" /&gt;&lt;br&gt;

   

    &lt;input id="Button3" class="x-tool x-tool-refresh" type="button" /&gt;

   

    &lt;input id="Button4" class="x-tool x-tool-refresh-over" type="button" /&gt;&lt;br&gt;

 

    &lt;input id="Button1" class="x-tool x-tool-plus" type="button" /&gt;

   

    &lt;input id="Button2" class="x-tool x-tool-plus-over" type="button" /&gt;&lt;br&gt;

   

    &lt;input id="Button3" class="x-tool x-tool-minus" type="button" /&gt;

   

    &lt;input id="Button4" class="x-tool x-tool-minus-over" type="button" /&gt;&lt;br&gt;

 

    &lt;input id="Button1" class="x-tool x-tool-search" type="button" /&gt;

   

    &lt;input id="Button2" class="x-tool x-tool-search-over" type="button" /&gt;&lt;br&gt;

   

    &lt;input id="Button3" class="x-tool x-tool-save" type="button" /&gt;

   

    &lt;input id="Button4" class="x-tool x-tool-save-over" type="button" /&gt;&lt;br&gt;

 

    &lt;input id="Button1" class="x-tool x-tool-help" type="button" /&gt;

   

    &lt;input id="Button2" class="x-tool x-tool-help-over" type="button" /&gt;&lt;br&gt;

   

    &lt;input id="Button3" class="x-tool x-tool-print" type="button" /&gt;

   

    &lt;input id="Button4" class="x-tool x-tool-print-over" type="button" /&gt;&lt;br&gt;

 

    &lt;input id="Button1" class="x-tool x-tool-expand" type="button" /&gt;

   

    &lt;input id="Button2" class="x-tool x-tool-expand-over" type="button" /&gt;&lt;br&gt;

   

    &lt;input id="Button3" class="x-tool x-tool-collapse" type="button" /&gt;

   

    &lt;input id="Button4" class="x-tool x-tool-collapse-over" type="button" /&gt;

&lt;/body&gt;

&lt;/html&gt;