Html 标签和标签样式不适用于我的表单。

Html 标签和标签样式不适用于我的表单。,html,css,forms,styling,Html,Css,Forms,Styling,我正在尝试使用标签设置表单样式,但标签样式似乎无法正常工作 以下是我的html在表单中的外观: <h1 class="allpages">Questions or Concerns about Compliance Issues?</h1> <h3>We welcome all compliments and constructive criticism!</h3> <form class="webform" action="h

我正在尝试使用标签设置表单样式,但标签样式似乎无法正常工作

以下是我的html在表单中的外观:

 <h1 class="allpages">Questions or Concerns about Compliance Issues?</h1>
 <h3>We welcome all compliments and constructive criticism!</h3>

    <form class="webform" action="http://hsc.unm.edu/scripts/cfmailform/cfmailer.cfm" method="post">
    <!--Required hidden operators--> 
    <input name="recipient" type="hidden" value="bfloran@salud.unm.edu" />
    <input name="subject" type="hidden" value="HSC Compliance Office Email Form" />
    <input type="hidden" name="cc" value="mgwilson@salud.unm.edu" />

    <input name="redirect" type="hidden" value="http://hsc.unm.edu/admin/compliance/ThankYOU.html" /> <!-- Field validation for the user -->

 <!-- Our form in HTML -->

 <label for "name">Your Name (optional):</label>


 <br />
 <input name="name" type="text" id="name" value="" /><br />
 Your E-mail (Optional):<br />
 <input name="mail" type="text" value="" />
 <br /> comment:<br /> <textarea name="comment" value="" ></textarea><br /> <br />     <input type="submit" value="Send" /> <br /> <input type="reset" value="Reset" /></div>
标签
不是类。。。这是一个标签。 为该作品制作CSS:

.webform label { } /* see .label changed to label */
另外:您的元素在HTML中没有正确布局,有些甚至不是标签


固定小提琴:
摘录:

.webform label {
    width:200px;
   vertical-align:top;
    text-align:right;
    float: left
}

<label for="name">Your Name (optional):</label>
<input name="name" type="text" id="name" value="" />
.webform标签{
宽度:200px;
垂直对齐:顶部;
文本对齐:右对齐;
浮动:左
}
您的姓名(可选):

您创建了一个类选择器来引用class=label的某个标记

预期的行为和实际发生的情况是什么?什么是“不工作”的意思。你能做一把小提琴吗?我想把实际的标签:(你的名字(可选):)放在左边,形状部分在右边,而不是标签在上面,形状部分在下面。谢谢谢谢在看了你的小提琴之后,我的答案是你想要的,但是很难看出你想要的结果是什么,因为有太多的无效图像扰乱了布局。谢谢Digital极端主义者。有点像,但是注释框仍然没有对齐,因为某些原因,即使在使用了您建议的代码之后。我想这可能是因为我使用了textarea标签。但是我又试了一次,它在小提琴上看起来很好,所以我不确定出了什么问题。是的,
textarea
input
标记不同,因此您可能需要调整您的策略以适应这种标记。
.webform label {
    width:200px;
   vertical-align:top;
    text-align:right;
    float: left
}

<label for="name">Your Name (optional):</label>
<input name="name" type="text" id="name" value="" />