Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

.bg-img {
  background-image:url(data:image/png;base64,iVBORw0KGgoAAAA... etc );
}

How can I refer to that image with an https prefix? When I go to the CSS that's how I see it.

Normally when you have an image src you can do the following:

background-image: url(https://domain.com/photo.png);

How can I use https for the data URI?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
207 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can't. DATA URI inherits the protocol of the page it's in. If your html is on https the data uri will have the same features of https. If your html is on http the data uri will have the same features of http.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...