Skip to content

Commit

Permalink
Added an example for constructing <div></div> tag
Browse files Browse the repository at this point in the history
  • Loading branch information
bharadwajyarlagadda committed Sep 2, 2016
1 parent 3b5472d commit aa0c95f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -478,3 +478,25 @@ Korona supports ``open`` attribute for ``<dialog>`` tag. Korona can help you bui
assert dialog_tag1 == '<dialog open >abcd</dialog>
assert dialog_tag1 == dialog_tag2
<div>
-----

Korona supports ``align`` attribute for ``<div>`` tag. Korona can help you build ``<div>`` tag.

.. code-block:: python
from korona.html.construct import Div
attributes = {'align': 'left', 'text': 'abcd'}
# You can pass in the attributes in the form of a dictionary.
div1 = Div(**attributes)
# You can also pass in the attributes as args.
div2 = Div(align='left', text='abcd')
div_tag1 = div1.construct()
div_tag2 = div2.construct()
assert div_tag1 == '<div align="left" >abcd</div>
assert div_tag1 == dialog_tag2

0 comments on commit aa0c95f

Please sign in to comment.