:before and background-image… should it work?

后端 未结 6 1610
死守一世寂寞
死守一世寂寞 2021-01-31 01:25

I\'ve got a div and apply :before and :after an image as content. That works perfectly. Now I would need to apply a background image so it does repeat

6条回答
  •  佛祖请我去吃肉
    2021-01-31 02:00

    Background images on :before and :after elements should work. If you post an example I could probably tell you why it does not work in your case.

    Here is an example: http://jsfiddle.net/namas/3/

    You can specify the dimensions of the element in % by using background-size: 100% 100% (width / height), for example.

提交回复
热议问题