利用css來截取大背景圖片

來源:互聯網
上載者:User

<style>
a#moveUser{width:225px;height:60px;margin:0 auto;line-height:900px;background:url

(http://images.warcraftchina.com/09v1/boot/moveUser.jpg) -3px -

7px;overflow:hidden;display:block;}
a#moveUser:hover{background-position:-3px -70px;}
</style>
<a href="http://www.battlenet.com.cn/account/creation/landing-cn.xml" title="開始綁定帳號"

target="_blank" id="moveUser">開始綁定帳號</a>

主要是規定這個區塊的大小

然後通過background-position這個屬性x y

x表示從左邊多少截取不截取為0截取為負數

y表示從上面截取

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.