Html 为什么我不能定位我的表格?
无论我尝试了什么,无论我尝试了什么,我似乎都无法定位表单。我用一个DIV来尝试定位表单,但它总是在页面的顶部:这是我的CSSHtml 为什么我不能定位我的表格?,html,css,forms,Html,Css,Forms,无论我尝试了什么,无论我尝试了什么,我似乎都无法定位表单。我用一个DIV来尝试定位表单,但它总是在页面的顶部:这是我的CSS contactform{ position : absolute; left : 415.50pt; top : 345.00pt; width : 252.75pt; height : 168.00pt; } 这是我的HTML <div id="contactFor
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>
谢谢你的帮助 您错过了
在CSS中,必须使用来引用ID和。转介课程 否则不能指向要操作的HTML元素。 这里你错过了CSS 所以改变你的代码 从
contactform{
position : absolute;
left : 415.50pt;
top : 345.00pt;
width : 252.75pt;
height : 168.00pt;
}
#contactform{
position : absolute;
left : 415.50pt;
top : 345.00pt;
width : 252.75pt;
height : 168.00pt;
}
对,
#contactform{
position : absolute;
left : 415.50pt;
top : 345.00pt;
width : 252.75pt;
height : 168.00pt;
}