pug - Jade spacing breaking buttons? -
i'm programming buttons in jade, , i'm little confused how spacing works.
the top example functions, leaves buttons close together.
the second example (with added space before "a(href
") breaks link while spacing buttons properly.
is jade sensitive spacing? can tell me whats going on here?
div.sub-menu div.wrapper a(href="#/microsite/a") input(type="button", class="button white-button", value="a" ) a(href="#/microsite/p") input(type="button", class="button white-button", value="p" ) div.sub-menu div.wrapper a(href="#/microsite/a") input(type="button", class="button white-button", value="a" ) a(href="#/microsite/p") input(type="button", class="button white-button", value="p" )
yes, jade sensitive spacing. spacing determines nesting of each tag.
so, following code
element child
would generate html:
<element><child></child></element>
the code
element child
would generate this:
<element></element><child></child>
which, of course, leads different result when viewed in browser.
to add space in front of each link, need insert adding after parent tag (you first link) or piping (on separate line before second link).
note when specifying tag contents / piping text, actual text content preceded white space. white space not outputted. so, in effect, pipe white-space need |
character followed two spaces.
e.g.:
div.sub-menu //- div.wrapper followed *two* spaces div.wrapper a(href="#/microsite/a") input(type="button", class="button white-button", value="a" ) //- | followed *two* spaces | a(href="#/microsite/p") input(type="button", class="button white-button", value="p" )
of course, if result not satisfactory can increase spacing using css padding , margin.
Comments
Post a Comment