我正在尝试将背景图像拉伸到父div的100%宽度和高度.IE8当然不支持background-size.我尝试了以下代码,但它不起作用.
.box:before {
background: url(images/body_background2.png) no-repeat;
display: block;
position: absolute;
z-index: -1;
height: 100%;
width: 100%;
content: '';
}
Run Code Online (Sandbox Code Playgroud) 如何通过使用jQuery单击来放大图像.我对此非常陌生,觉得我在圈子里,请帮忙.谢谢!
这是HTML部分:
<div class="box">
<img id="image1" src="css/images/smallknife.png">
<p>$50.00</p>
</div>
<div id="dialog" style="display: none;">
<img src="css/images/smallknife.png">
</div>
Run Code Online (Sandbox Code Playgroud)
这是jQuery部分
$('#image1').click(function(){
$("#dialog").dialog();
});
Run Code Online (Sandbox Code Playgroud) 我有一个电子邮件表单,检查三个字段,名称,有效的电子邮件和评论.但是它现在的设置方式,因为名称和注释在一个函数中,它首先检查名称和注释,即使电子邮件无效,我如何重新编写它以便按顺序检查字段.此外,我想重新显示没有错误的字段,因此用户不必再次键入.请帮忙.谢谢
<?php
$myemail = "comments@myemail.com";
$yourname = check_input($_POST['yourname'], "Enter your name!");
$email = check_input($_POST['email']);
$phone = check_input($_POST['phone']);
$subject = check_input($_POST['subject']);
$comments = check_input($_POST['comments'], "Write your comments!");
if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
{
show_error("Enter a valid E-mail address!");
}
exit();
function check_input($data, $problem='')
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
if ($problem && strlen($data) == 0)
{
show_error($problem);
}
return $data;
}
function show_error($myError)
{
?>
<!doctype html>
<html>
<body>
<form action="myform.php" method="post">
<p style="color: red;"><b>Please correct the following error:</b><br …Run Code Online (Sandbox Code Playgroud)