MCPcopy Create free account
hub / github.com/PageBot/PageBot / img

Method img

Lib/pagebot/contexts/htmlcontext/htmlbuilder.py:1466–1480  ·  view source on GitHub ↗

The img tag defines an image. The img tag has no block. To avoid compatibility problems between browser with the default border value, it is set to 0 if not defined. http://www.w3schools.com/tags/tag_img.asp >>> b = HtmlBuilder() >>> b.compact = True

(self, **args)

Source from the content-addressed store, hash-verified

1464 self._closeTag('canvas')
1465
1466 def img(self, **args):
1467 """The img tag defines an image. The img tag has no block.
1468 To avoid compatibility problems between browser with the default border value,
1469 it is set to 0 if not defined.
1470 http://www.w3schools.com/tags/tag_img.asp
1471
1472 >>> b = HtmlBuilder()
1473 >>> b.compact = True
1474 >>> b.img(src="myImage.png", cssClass="myClass", width="100%")
1475 >>> b.getHtml()
1476 '<img class="myClass" src="myImage.png"/>'
1477 """
1478 if not args.get('border'):
1479 args['border'] = 0
1480 self.write_tag('img', False, args)
1481
1482 def map(self, name):
1483 self.write('<map name="%s">' % name)

Callers 4

imageMethod · 0.80
build_htmlMethod · 0.80
build_htmlMethod · 0.80
build_htmlMethod · 0.80

Calls 2

write_tagMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected