:before and :after elements on an img element

后端 未结 1 1352
走了就别回头了
走了就别回头了 2020-12-22 08:41

Is it possible to use before and after psuedo selectors on an img element? Thought it was but not having any luck, switched the css over to a div and it works fine. The

1条回答
  •  生来不讨喜
    2020-12-22 09:24

    :before and :after pseudo-elements cannot be used for void elements, since they specify content to be prepended or appended to the element's actual content, whereas void elements can have no content.

    0 讨论(0)
提交回复
热议问题