比如在网页中把所有按钮的背景图作成一张大图,所有按钮就是通过截取这张大图的某一部分来显示

解决方案 »

  1.   

    如果是用图来做背景的话,可以设置背景的position属性(即背景的x,y坐标)来选择。不知道能不能帮到你。
      

  2.   

    通过background的position属性就可以了
    然后在指定大小
    css sprite
      

  3.   

    LZ要的是这效果吗?
    点图中我爱罗的脸……  <img src="http://avatar.csdn.net/A/6/7/1_li7134551921.jpg" border="0" usemap="#Map2">
      <map name="Map2">
    <area shape="rect" coords="10,40,100,130" href="http://www.google.com"><!-- 左侧大块 -->
    <area shape="rect" coords="160,45,190,75" href="http://www.baidu.com"><!-- 右侧小块 -->
      </map>