【发布时间】:2023-03-18 20:30:02
【问题描述】:
有没有办法将节点值继承到content 属性中?
例如,如果<h2/> 标签值设置为“随机标题”,我可以在 CSS 中的content 属性中获取此值吗?
我试过content: inherit;,但它似乎不起作用。
我的理论的一个例子:
HTML:
<h2>Random title</h2>
CSS:
h2:after {
content: inherit; /* should be "Random title" */
}
提前致谢!
【问题讨论】:
-
如果只想镜像文本,可以使用
text-shadow: black 20em 0 0;
标签: css css-content