8

是否可以将base64背景图像放在多行而不是一长行中?如果是这样,怎么做?

我当前的正文 CSS 是:

body {
  background-color:  #FFFFFF;
  background-image:  url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZSURBVBhXY/iABP4jAQYqSiCbi2wsA/UkAIeAuaFCb0TzAAAAAElFTkSuQmCC);
  background-repeat: repeat;
  height: 100%;
}
4

1 回答 1

24

将您的代码放在引号之间并在换行之前放置一个反斜杠。

body {
    background-color:  #FFFFFF;
    background-image:  url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUg\
    AAAAgAAAAICAIAAABLbSncAAAAAXNSR0IArs4c6QAAAARnQ\
    U1BAACxjwv8YQUAAAAJcEhZcwAADs\
    MAAA7DAcdvqGQAAAAZSURBVBhXY/iABP4j\
    AQYqSiCbi2wsA/UkAIeAuaFCb0TzAAAAAElFTkSuQmCC');
    background-repeat: repeat;
    height: 100%;
}
于 2012-07-09T15:32:05.113 回答