开发者

Using :before and :after CSS selector to insert HTML [duplicate]

开发者 https://www.devze.com 2023-03-02 23:25 出处:网络
This question already has answers here: 开发者_如何学JAVA Can you add line breaks to the :after pseudo element?
This question already has answers here: 开发者_如何学JAVA Can you add line breaks to the :after pseudo element? (4 answers) Closed 4 years ago.

I'm wondering if the following is possible. I know it doesn't work, but maybe I'm not writing it in the correct syntax.

li.first div.se_bizImg:before{
    content: "<h1>6 Businesses Found <span class="headingDetail">(view all)</span></h1>";
}

Any way of doing this?


content doesn't support HTML, only text. You should probably use javascript, jQuery or something like that.

Another problem with your code is " inside a " block. You should mix ' and " (class='headingDetail').

If content did support HTML you could end up in an infinite loop where content is added inside content.

0

精彩评论

暂无评论...
验证码 换一张
取 消