gpt4 book ai didi

css - 在 jQuery Mobile 中删除 <input> 周围的 "margin"

转载 作者:太空宇宙 更新时间:2023-11-04 13:31:23 27 4
gpt4 key购买 nike

jQuery Mobile 自动将其添加到 <input>。我怎样才能覆盖它并从 div 中删除上边距?

<div class="ui-input-text ui-body-inherit ui-corner-all ui-shadow-inset">
<input id="myinput">
</div>

div 的 css 看起来像:

.ui-input-text input, .ui-input-search input, textarea.ui-input-text {
-moz-box-sizing: border-box;
display: block;
line-height: 1.4em;
outline: 0 none;
padding: 0.4em;
width: 100%;
}

最佳答案

DEMO

您可以使用父容器类名为输入编写新的 CSS,以便它具有更高的优先级

HTML

<div class="wrap">
<div class="ui-input-text ui-body-inherit ui-corner-all ui-shadow-inset">
<input id="myinput" />
</div>
</div>

CSS

.wrap .ui-input-text input{
border:1px solid red; /*desired style*/
margin-top:0;
}

关于css - 在 jQuery Mobile 中删除 &lt;input&gt; 周围的 "margin",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23337317/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com