是否可以将base64背景图像放在多行而不是一行?如果是这样,怎么样?
我目前的身体CSS是:
body { background-color: #FFFFFF; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZSURBVBhXY/iABP4jAQYqSiCbi2wsA/UkAIeAuaFCb0TzAAAAAElFTkSuQmCC); background-repeat: repeat; height: 100%; }
解决方法
将代码放在引号之间并在断开新行之前加上反斜杠.
body { background-color: #FFFFFF; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUg\ AAAAgAAAAICAIAAABLbSncAAAAAXNSR0IArs4c6QAAAARnQ\ U1BAACxjwv8YQUAAAAJcEhZcwAADs\ MAAA7DAcdvqGQAAAAZSURBVBhXY/iABP4j\ AQYqSiCbi2wsA/UkAIeAuaFCb0TzAAAAAElFTkSuQmCC'); background-repeat: repeat; height: 100%; }