【发布时间】:2022-02-09 17:06:48
【问题描述】:
看起来很简单,但我正在失去理智。
我想独立格式化两种不同的表格。这是一个例子。
<h1>FORM 1</h1>
<form>
<input type="text" name="name" placeholder="Name" required>
<input type="email" name="email" placeholder="Email" required>
<input type="password" name="password" placeholder="Password" required>
<input type="submit" value="Register"/>
</form>
<br>
<h1>FORM 2</h1>
<form id="form2">
<input type="text" name="name" placeholder="Name" required>
<input type="email" name="email" placeholder="Email" required>
<input type="password" name="password" placeholder="Password" required>
<input type="submit" value="Register"/>
</form>
/* Form 1 style */
input[type="text"],
input[type="password"],
input[type="email"],
select{
display:block;
width: 100%;
margin-top: 2px;
margin-bottom: 2px;
}
/* Form 2 style? */
input[type="text"],
input[type="password"],
input[type="email"],
select{
display:block;
width: 50%;
margin-top: 1px;
margin-bottom: 1px;
}
https://jsfiddle.net/dtpoze0c/
非常感谢任何帮助。
【问题讨论】: