Putting Images Inside a BUTTON Element (HTML & CSS)

后端 未结 5 1647
闹比i
闹比i 2020-12-28 21:53

I have a simple button (as shown below) on which I need to display two pictures, one on either side of the button text. Im battling to create the CSS that will work in both

5条回答
  •  被撕碎了的回忆
    2020-12-28 22:23

    I would use spans not divs for the image containers, since you seem to want the images to appear inline. Using floated divs is just too complex.

    In fact, you could probably simplify things further by applying one background image to the button itself, and one to the button-text span, and removing the other two containers altogether.

    Another alternative is to simply add the images in as img tags.

提交回复
热议问题