我有一个HTML表单。我想通过使它们变成粗体来表明一些字段是必需的。原则上,这应该进入CSS而不是HTML吗?你会怎么做?以粗体显示必填字段
<form action="doit" id="doit" method="post">
<label>
Name
<input id="name" name="name" type="text" />
</label>
<label>
Phone number
<input id="phone" name="phone" type="text" />
</label>
<label>
Year
<input id="year" name="year" type="text" />
</label>
</form>
完美的非HTML5答案,基于CSS的答案。 +1 – Singular1ty 2013-05-05 01:04:58