gpt4 book ai didi

css - HTML 中 iPhone 的类似聚光灯的框

转载 作者:行者123 更新时间:2023-11-28 18:08:02 25 4
gpt4 key购买 nike

我正在使用 IE 7。任何人都可以为我正在尝试做的事情建议一个更简单的代码。

这是我的 html:

    <span id="mainSpan" class="deleteIcon">
<input type="text" id="txt1" />
<span id="btn" onclick="var x = document.getElementById('txt1'); x.value = ''; x.focus();"></span>
</span>

和我的CSS:

        input {
font-size: 20px;
width: 250px;
}
#mainSpan {
position: relative;
border: 1px #aaa inset;
}
span.deleteicon span {
border: none;
margin-left: 1px;
position: absolute;
display: block;
top: 5px;
width: 18px;
height: 18px;
background: url('file:///path-to-clear.png') no-repeat center;
cursor: pointer;
}
span.deleteicon input {
border: none;
margin: 0px;
padding-right: 0px;
}

但在 IE 7 中看起来像这样:

enter image description here

我想让它像 iPhone 中的聚光灯一样:

enter image description here

如果我希望在光标位于框中时显示“清除”按钮,我是否需要 css 或 javascript?像这样..

enter image description here

在其他较新的浏览器中很容易做到,但需要在 IE 7 上使用它。

感谢任何可以分享其代码的人。 =D

最佳答案

尝试 ccs3pie

它有助于古老的 IE。您将能够使用边界半径和其他很酷的东西。

关于css - HTML 中 iPhone 的类似聚光灯的框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19216270/

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