无论我尝试过什么,无论我尝试过什么,我似乎都无法定位表格。我用 DIV 将表单括起来以尝试定位,但它始终位于页面顶部:这是我的 CSS。
contactform{
position : absolute;
left : 415.50pt;
top : 345.00pt;
width : 252.75pt;
height : 168.00pt;
}
这是我的 HTML
<div id="contactForm">
<form class="cmxform" id="commentForm" method="get" action="">
<fieldset>
<legend>Please provide your name, email address (won't be published) and a comment</legend>
<p>
<label for="cname">Name (required, at least 2 characters)</label>
<input id="cname" name="name" minlength="2" type="text" required/>
</p>
<p>
<label for="cemail">E-Mail (required)</label>
<input id="cemail" type="email" name="email" required/>
</p>
<p>
<label for="curl">URL (optional)</label>
<input id="curl" type="url" name="url"/>
</p>
<p>
<label for="ccomment">Your comment (required)</label>
<textarea id="ccomment" name="comment" required></textarea>
</p>
<p>
<input class="submit" type="submit" value="Submit"/>
</p>
</fieldset>
</form>
<script>
$("#commentForm").validate();
</script>
</div>
感谢您的帮助!
最佳答案
你错过了#
#contactform
{
position : absolute;
left : 415.50pt;
top : 345.00pt;
width : 252.75pt;
height : 168.00pt;
}
关于html - 为什么我不能定位我的表格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23464264/