Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在文本框ex:searchbox上设置背景图像样式的最佳方法是什么_Html_Css - Fatal编程技术网

Html 在文本框ex:searchbox上设置背景图像样式的最佳方法是什么

Html 在文本框ex:searchbox上设置背景图像样式的最佳方法是什么,html,css,Html,Css,我以前也这么做过,但出于某种原因,我现在正在尝试使用fieldset来显示背景图像,我只能让它在firefox中看起来不错。在文本框中添加背景图像是一个很好的跨浏览器解决方案 我尝试的例子 <div class="subscribe"> <form method="get" id="searcform" action=""> <fieldset class="search">

我以前也这么做过,但出于某种原因,我现在正在尝试使用fieldset来显示背景图像,我只能让它在firefox中看起来不错。在文本框中添加背景图像是一个很好的跨浏览器解决方案

我尝试的例子

<div class="subscribe">
                <form method="get" id="searcform" action="">
                    <fieldset class="search">
                        <input type="text" class="box" value="Subscribe to Email Newsletter" />
                        <button class="btn" title="Subscribe">Subscribe</button>
                    </fieldset>
                </form>
            </div>

订阅

我不确定您确切的意思是什么,但以下内容应该有效:

input[type=text],
textarea {
    background: #fff url(path/to/image.png) 0 0 no-repeat;
}

只需使您的输入透明并放置在容器div中即可

例如:


跨浏览器友好。

而“文本框”的意思是
。?我的意思是,我使用的是我设置圆形输入图像作为背景的地方@josh:请编辑问题的进一步细节,如果可能,提供当前实现的详细信息。