使用:before和:之后的CSS选择器插入Html [英] Using :before and :after CSS selector to insert Html
本文介绍了使用:before和:之后的CSS选择器插入Html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Possible Duplicate:
Can you use the :after pseudo element to add html?
我想知道如果以下是可能的。我知道它不工作,但也许我不是用正确的语法写。
I'm wondering if the following is possible. I know it doesnt 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>";
}
这样做吗?
推荐答案
内容
不支持HTML,只支持文本。你应该使用jQuery或类似的东西。
content
doesn't support HTML, only text. You should probably use jQuery or something like that.
您的代码的另一个问题是里面
块。您应该混合
'
和(
class ='headingDetail'
)。
Another problem with your code is "
inside a "
block. You should mix '
and "
(class='headingDetail'
).
如果 content
支持HTML,您可能会遇到无限循环, content
添加在 content
内。
If content
did support HTML you could end up in an infinite loop where content
is added inside content
.
这篇关于使用:before和:之后的CSS选择器插入Html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文