Is it possible to set the equivalent of a src attribute of an img tag in CSS?

后端 未结 25 2565
借酒劲吻你
借酒劲吻你 2020-11-22 09:30

Is it possible to set the src attribute value in CSS? At present, what I am doing is:


25条回答
  •  醉梦人生
    2020-11-22 09:58

    If you are trying to add an image in a button dynamically based on the context of your project, you can use the ? take to reference the source based on an outcome. Here I am using mvvm design to let my Model.Phases[0] value determine whether I want my button to be populated with images of a lightbulb on or off based on the value of the light phase.

    Not sure if this helps. I'm using JqueryUI, Blueprint, and CSS. The class definition should allow you to style the button based on whatever you'd like.

        

提交回复
热议问题