html - 在 "content"内添加 css 元素

标签 html css

<分区>

是否有任何 CSS 方法可以在 css 内容属性中添加 div、p、span 元素? 我的意思是这样的代码

.textblockquote:before{
content: "<span class='green'>“</span>";

最佳答案

除了文本元素,你不能用css插入其他东西

但是,你想做的可以通过这种方式实现:

.textblockquote:before{
    color:green; /* <-- apply the styling you want */
    content: "\0022"; /* <-- escaped unicode for 'quote' */
}

与此同时,您的问题已经得到解答(30 个月前):Using :before and :after CSS selector to insert Html

看:enter image description here

关于html - 在 "content"内添加 css 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20546929/

上一篇:html - CSS:响应式背景图片高度

下一篇:html - 覆盖相等的 Bootstrap 类以使用 Bootstrap css?

相关文章:

javascript - 在一个网页中处理两种形式

Javascript 动画 : stop doing multiple jumps

javascript - Bootstrap 模式表单未提交

html - 缩短在 CSS 中使用的 html ID

html - 仅在小型设备上添加行 - bootstrap

jquery - CSS:滚动时静止图像,但下方内容位于其上方

css - IE 不在表格单元格中居中文本

javascript - 图片资源可用于 CSS 文件而不是 JS 文件——为什么?

css - Angular 2 - 是否可以将绝对路径添加到例如样式.78f022854070df211b2d.css?

javascript - 使用 jquery 旋转后其他元素的不当行为