【发布时间】:2013-07-30 20:19:08
【问题描述】:
bootstrap 中的表单有一个盒子阴影,在表单的右侧留下一个非常浅的阴影。我只需要删除右侧的阴影,以便图标看起来与表单分开。
JSFiddle:http://jsfiddle.net/MgcDU/6296/
这是 CSS:
textarea,
input[type="text"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="color"],
.uneditable-input {
background-color: #ffffff;
border: 1px solid #cccccc;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
-moz-transition: border linear 0.2s, box-shadow linear 0.2s;
-o-transition: border linear 0.2s, box-shadow linear 0.2s;
transition: border linear 0.2s, box-shadow linear 0.2s;
}
HTML:
<a href="#">
<div class="input-append">
<input class="span4" id="appendedInput" type="text" placeholder="Search..." style="border-right:0;">
<span class="add-on" style="background:white;border-left:0;"><i class="icon-search" style="color:#a3a3a3"></i></span>
</div>
</a>
请帮忙!
【问题讨论】:
-
也遇到了类似的问题;我通过添加一个绝对定位的元素来修复它,该元素宽度为几个像素,并且在用户与功能交互时与阴影重叠。我使用jQuery来触发定位。
-
肯定有比这更好的方法...
-
我遇到的问题是有时我需要补丁,有时不需要(类似于您基于输入焦点的情况)。因此,当我触发需要补丁的事件时,我还显示了 HTML 补丁,然后在触发器再次触发时将其隐藏。其实并不难。
标签: html css twitter-bootstrap