passwordfield背景图片

用户名

目前,我正在尝试将背景图像设置为HTML密码输入字段,尽管这对于正常的输入字段似乎可以正常工作,但密码字段中却没有背景图像。代码如下:在css中:

.pw-style{
background: URL(".../test.jpg");
}

在HTML中:

<input class="pw-style" type="password"> ... </input>

这是适用于普通输入字段的示例:http : //www.atseadesign.com/demos/form_field_with_image.html

动词

您可以尝试使用内联CSS:

<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>

并添加Jquery代码,如下所示:

$(document).ready(function(){  

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

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

});  

});  

希望对您有帮助。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章