我有这个HTML表单(在一个表中)
<style type="text/css">
form {
text-align:center;
background:url(padlock_closed.png) no-repeat;
}
</style>
<form>
<table width="600" border="0" align="center" cellpadding="5" cellspacing="5">
<tr>
<td width="199"><strong>Forename</strong></td>
<td width="366"><input type="text" name="forename" size="50" /></td>
</tr>
<tr>
<td><strong>Surname</strong></td>
<td><input type="text" name="surname" size="50" /></td>
</tr>
<tr>
<td><strong>Email</strong></td>
<td><input type="text" name="email" size="50" /></td>
</tr>
</table>
</form>它目前有一个图像背景,但我希望它看起来像它显示在前面的形式,而不是后面,并使图像中心也?
做这件事最好的方法是什么?
发布于 2013-09-03 11:06:16
取决于您的方法,您希望先单击按钮以使图像出现,还是已经存在?
要使图像不透明,可以使用CSS3和“filter”来实现IE兼容性:
#id-of-image {
opacity: 0.8;
filter: alpha(opacity=80); //IE support
}(您可以更改值)
若要将图像置于窗体上方,请使用css定位(相对、绝对、相对)。
发布于 2013-09-03 11:27:12
我建议您使用jquery弹出。
添加div类
<div id="dialog-modal-loading" style="display:none;">
<img src="images/your_image.gif">
</div>调用javascript函数弹出。根据你的意愿改变高度和宽度。
function call_dialog(){
$( "#dialog-modal-loading" ).dialog({
height: 180,
width: 180,
modal: true,
closeOnEscape: false,
resizable: false,
position: 'center',
beforeclose: function (event, ui) { return false; },
dialogClass: "noclose"
});
$('.ui-dialog').css('opacity','0.2');
} https://stackoverflow.com/questions/18590600
复制相似问题