css - JQuery mobile/在 ListView 中输入文本

标签 css jquery-mobile

我有几个输入字段位于 ListView 条目内。所以现在我正在尝试 设置输入字段的 CSS 样式,使其看起来像普通的 ListView 条目。

输入字段将由 Angular 的 ng-model 填写,但这并不重要。

这就是我到目前为止所做的,但我认为我需要边距/填充等方面的帮助。

// CSS input
.ui-input-text{ 
  border: none !important;
  box-shadow: none !important;
  background-color : transparent;
}

// HTML
<ul data-role="listview" data-divider-theme="b">
<li data-role="list-divider">Verbraucher</li>
<li data-mini="true"> <a href="#">
// This should look like a "normal" listview entry!
<input type="text" ng-model="cust.firstname" name="cust_firstname" required>    
</a></li>
... 

listview

两者看起来应该是一样的!

最佳答案

尝试将以下内容添加到您的 CSS 中:

.ui-input-listview {
  margin-top: -1em !important;
  margin-bottom: -1em !important;
  margin-left: -0.5em !important; /* If you want to fix left as well */
  margin-right: -0.5em !important; /* If you want to fix right as well */
}

然后,对于listview中的输入,将类设置为ui-input-listview

<input class="ui-input-listview" type="text" ng-model="cust.firstname" name="cust_firstname" required="required">

jsFiddle 在这里 - http://jsfiddle.net/EnF2w/1/

关于css - JQuery mobile/在 ListView 中输入文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17966608/

相关文章:

html - 如何去除weebly中二级菜单项中的箭头?

javascript - 网站设计 - 向版 block 添加形状

html - anchor 元素没有正确对齐

jquery - 尽管有内容 div,但使 div 容器高度为 100%

jquery - 绑定(bind)到移动设备硬件按钮

jquery-mobile - 使用 JQuery Mobile 和 Phonegap 缩放 HTML 内容

ios - jquery mobile - 无法仅在 iOS 中注册点击 data-role=content

css - 将每个 html 元素放在单独的行中

jquery - 使用 Jquery Mobile 的 DOM 异常 12

android - 下拉菜单背景在 Android 应用中变为黑色