Reputation: 11
I have an image server in tornado, the code is:
class Index(tornado.web.RequestHandler):
def get(self):
header = "image/png"
ifile = open("image.png","r")
self.add_header("Content-Type",header)
self.write(ifile.read())
I used this image in <img src="http://localhost:8888/img" />
and this works fine but it doesn't work when called in a css background-image, example: <div style="background-image:url(http://localhost:8888/img)"></div>
.
Upvotes: 0
Views: 562
Reputation: 951
your is correct but height of dev
is 0
and for this resean not shown.
<div style="background-image:url(http://localhost:8888/img); min-height: 100px; background-repeat: repeat;"> </div>
Upvotes: 2