简体   繁体   English

ctrl + c来自CSS的“内容”

[英]ctrl+c “content” from css

trying to create a flexible mailing list with little JS: 尝试使用少量JS创建灵活的邮件列表:

.email_item::after {
     content: ", ";
}

resulting in: 导致:

foo@mail.com, foo2@mail.com

replicating with ctrl+c and ctrl+v returns: 使用ctrl + c和ctrl + v复制将返回:

foo@mail.comfoo2@mail.com

I'm going to have to use JS right? 我将不得不使用JS,对吗? Or is there an optimizing genius out there? 还是那里有一个优化的天才?

Yes, generated content like :after and :before is for display purposes only. 是的,生成的内容如:after:before仅用于显示目的。
It does not alter the DOM so it is not selectable.. 它不会更改DOM,因此它是不可选择的。

Why use JS and not directly add the comma at the HTML ? 为什么使用JS而不直接在HTML处添加逗号?

Quoting the specs about content 引用有关content的规范

Generated content does not alter the document tree. 生成的内容不会更改文档树。 In particular, it is not fed back to the document language processor (eg, for reparsing). 特别是,它不会反馈给文档语言处理器(例如,用于重新解析)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM