【发布时间】:2014-07-11 00:29:13
【问题描述】:
我创建了一个电子邮件表单,并且我有一个图像我想成为整个表单的背景。我尝试过使用 CSS background-image 以及使用 html 来使用背景图片。
我发现的所有教程都只是向我展示了如何将图像作为实际的文本框(即搜索表单内的放大镜)。我希望图像位于整个表单的后面。
我的代码当前生成的内容:http://testing.egfederation.com/contact/contact.php
我的 HTML
<div id = "contentwrap"><div class = "contact">
<img src="CSS/Bracket.png">
<form method="post" action="<?php echo $_SERVER["PHP_SELF"];?>">
<input type ="text" name = "message" placeholder="Full Name"> <br>
<input type="text" name="from" placeholder="Email Address"><br>
<input type="text" name="subject" placeholder="Subject"><br>
<textarea rows="10" cols="35" name="message" placeholder="Please Enter your message here."></textarea><br>
<input type="submit" name="submit" value="Submit">
</form></div> </div>
我的 CSS
.contact {
height:600px;
width:800px;
margin-left:auto;
margin-right:auto;
}
#contentwrap {
float:right;
}
.contact img{
z-index:-1;
}
【问题讨论】:
-
您需要将其设置为分配给类/id的背景图像。
标签: php html css image background