【发布时间】:2012-10-07 09:03:42
【问题描述】:
如何在 JADE 中的内联文本和输入项之间留出空格?
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
我的输出是:
我无法在标签和文本区域之间获得空间。
【问题讨论】:
-
这看起来更像是一个 CSS 问题而不是 Jade 问题。
-
不,这不是 CSS 问题。不直接堆叠在一起的 inline-block 元素将有几个像素的空白,而直接堆叠在一起的则不会。这是一个 HTML 问题,需要在模板语言中加以考虑。 Slim 通过允许您设置是否需要尾随空格来解决此问题。默认情况下没有尾随空格。
标签: pug