Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.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 密码域背景图像_Html_Css_Image_Background - Fatal编程技术网

Html 密码域背景图像

Html 密码域背景图像,html,css,image,background,Html,Css,Image,Background,目前,我正在尝试将背景图像设置为HTML密码输入字段,虽然这对于正常的输入字段似乎很好,但在密码字段中没有背景图像。代码如下: 在css中: 在HTML中: <input class="pw-style" type="password"> ... </input> 。。。 下面是一个适用于普通输入字段的示例: 您可以尝试使用内嵌css: <input style="background-image: url('.../test.jpg')" type="pass

目前,我正在尝试将背景图像设置为HTML密码输入字段,虽然这对于正常的输入字段似乎很好,但在密码字段中没有背景图像。代码如下: 在css中:

在HTML中:

<input class="pw-style" type="password"> ... </input>
。。。
下面是一个适用于普通输入字段的示例:
您可以尝试使用内嵌css:

<input style="background-image: url('.../test.jpg')" type="password"> ... </input>

我希望这对您有帮助。

您有什么问题吗?我尝试过使用密码,它可以工作。当我将类型更改为密码时,它可以在您的页面上工作。此外,不应该使用JavaScript进行聚焦和模糊。只需使用
input:focus
就可以了。C Travel:那是个打字错误,我用的是“pw风格”。为错误道歉。gvee:我的问题是,如何将背景图像添加到密码字段中。凯马斯:你到底试过什么您的问题在别处。感谢您迄今为止的回答,问题如下:background:URL(“…/test.jpg”);不工作,但背景图像:URL(“…/test.jpg”);做现在我又遇到了另一个问题,在带有简单密码字段的页面上,这种方法现在可以使用了(例如),但在谷歌邮件登录和其他更复杂的网站上就不行了(例如)。你知道是什么导致了这个问题吗?在第二个链接中,我看不出问题所在。请更明确地说明您的问题。在第一个链接中,我可以在输入字段中看到背景图像,而在第二个链接中,我看不到背景图像。应该提到的是,我编写了一个firefox插件,如果站点不使用ssl,它可以在密码字段中设置图片。我试图通过使用上述代码来实现这一点。在我使用firebug检查了来自您的第二个链接的输入后,我得到以下信息:。你的输入没有设置类是的,当然你看不到设置了类,因为设置类的js在firefox上本地运行-我编写了一个firefox插件来更改主页的外观,并希望更改密码输入字段的背景。但这在谷歌的登录页面上并不起作用。
<input style="background-image: url('.../test.jpg')" type="password"> ... </input>
<div class="slidingDiv" style="float:left; background-image: url('.../test.jpg')></div>
<input class="show_hide" style="float:left;" type="password"> ... </input>
<div style="clear:both"></div>
$(document).ready(function(){  

$('.show_hide').click(function(){  

$(".slidingDiv").slideToggle();  

});  

});