space between inline text and input items in JADE?
如何在JADE中的内联文本和输入项之间留出空格?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | div(data-role="horizontal", data-theme="a", data-overlay-theme="a", data-inline="true",class="ui-bar ui-grid-c") div(class='ui-block-a') div(data-role='fieldcontain') label(for='memberaddress') Address Proof textarea(id='memberaddress',name='memberaddress') div(class='ui-block-b') div(data-role="fieldcontain") label(for="proof") Proof ID select(name='proof', id='proof', data-theme='a', data-icon='bank', data-inline='true', data-native-menu="false") option(value='0') Select Proof option(value='1') Voter ID option(value='2') Driving Licence option(value='3') PANCARD option(value='4') Ration Card div(class='ui-block-c') div(data-role="fieldcontain") input(type='checkbox', name='addressmatchedCheck', id='addressmatchedCheck', data-inline="true") label(for='addressmatchedCheck') Address Matched |
我的输出是:
我无法在标签和文本区域之间留出空间。
按照jonathan ong的建议将边距添加到CSS中,或者可以在标签和textarea之间添加
还有"漂亮"选项
您应该可以这样调用玉石(请参阅http://jade-lang.com/api/):
1 | var fn = jade.compile('string of jade', {pretty: true}); |
它将在模板中所有节点之间的输出中插入换行符和缩进。
如果您只想插入一个空格,则选项为
1 2 3 | label(for='memberaddress') Address Proof =' ' textarea(id='memberaddress',name='memberaddress') |
选项1(我的选择)
1 2 3 | input(type='button') | input(type='button') |
选项2
1 2 3 | input(type='button') = ' ' input(type='button') |
选项3
1 2 3 | input(type='button') | input(type='button') |
不过还有其他人。...
正如在其他答案中已经确定的那样,问题确实出在Jade创建的html而不是css。也就是说,一种创建空间而不更改标记的方法是在
@leff使用
我认为最好的选择是每当需要插入允许文本换行的空白时使用
您将在w3c字符实体参考页面上找到