gpt4 book ai didi

css - 是否可以在 CSS 规则中连接两个字符串?

转载 作者:行者123 更新时间:2023-11-28 10:16:26 26 4
gpt4 key购买 nike

我试图将以下 CSS 规则分成两行:

background: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBR‌​AA7") 0 0 repeat;

我尝试将 url base64 字符串拆分为两个子字符串,以避免根据 style guide for an open source project called PDF.js 超过行长度.

我尝试执行“xxxx”+“xxxx”但没有用。

所以我想知道以前是否有人尝试过这样做,或者是否有可能在 css 规则中连接两个字符串?

最佳答案

根据CSS2规范http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#strings ,没有连接操作。但是,出于美观原因,您可以将字符串分成多行。

It is possible to break strings over several lines, for aesthetic or other reasons, but in such a case the newline itself has to be escaped with a backslash ().

所以我的问题的解决方案是:

  background: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAA\
LAAAAAABAAEAAAIBR‌​AA7") 0 0 repeat;

Which is kind of related to this question

关于css - 是否可以在 CSS 规则中连接两个字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23945623/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com