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

标签 css internet-explorer-7

我正在使用 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/

相关文章:

css - IE7 重叠文字

html - 在 <li> 中将对齐设置为图像的中心

javascript - 在html页面上用按钮覆盖图像

javascript - Jquery slider 不能自动工作

javascript - 如何使字体很棒的插入符号从插入符号右变为插入符号向下?

css - Angular ng-show 在 IE7/8 中不起作用

css - 必填字段指示器在 IE7 和 IE6 中不起作用

javascript - Jquery 的 ie7 问题,也可能是 html

jquery - CSS/jQuery : How can I get a scrollable area to re-size properly when the container is re-sized?

html - IE7 文本对齐 :right not working