在输入文本字段中显示背景图像 [英] show background image in the input text field

查看:179
本文介绍了在输入文本字段中显示背景图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有背景图片的简单HTML页面,现在我要在此HTML页面上应用联系表单。

I have a simple HTML page with background image, and now I'm applying a contact form on this HTML page.

我要显示背景图片文本输入字段即,我想让输入文本字段透明。我使用CSS代码 background-color:transparent; ,但它不工作。


I want to show the background image in the text input field i.e, I want to make input text field transparent. I have use CSS code background-color:transparent;, but it doesn't work. I am getting a white background for input text field.

推荐答案

尝试此

.contact
{
    background: url(http://th06.deviantart.net/fs71/200H/i/2013/286/0/4/cygnus_loop_nebula__cropped__stock__by_tandps_artresources-d6qb45e.jpg) no-repeat right center;
    height:100px;
    width:200px;
    padding:10px;
}
.contact input[type="text"]
{
    background:rgba(0,0,0,0);
    border:1px solid #fff;
    color:#fff;
}

http://jsfiddle.net/2ZmFA/

这篇关于在输入文本字段中显示背景图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆