search

Home  >  Q&A  >  body text

How can I enlarge the background icon?

1537515817(1).jpg

For example, in the background picture of this chapter, there are many icons in the picture. I only want the first icon. How can I make an icon larger? The width and height of this icon are only 30px*30px. I have css Write like this: background: url (../images/xxx.png); background-position: 0px -30px; padding: 40px; width: 40px height: 40px;. But the icon is still only as big as it was originally and will not change as the width and height change

Please help me!

何惜一博何惜一博2290 days ago1309

reply all(2)I'll reply

  • 藏色散人

    藏色散人2018-09-21 16:56:52

    A property background-size

    in css3

    reply
    0
  • 何惜一博

    I've used this too, but it didn't work. It will only work if the background image has only one icon. It seems that it cannot be used with background-position.

    何惜一博 · 2018-09-23 10:51:23
  • Cancelreply