我在尝试创造这样的设计
我试着添加一个边距和填充,但它不起作用。
我试图在标签和输入之间添加一个空格,但它也不起作用。
div.register {
background-color: white;
width: 100%;
height: 400px;
border-radius: .5rem;
width: 300px;
}
.register input {
width: 250px;
border-radius: 1rem;
margin-left: 8px;
}
<section class="home show-animate" id="home">
<div class="content">
<span>Take The Right Step <br>For Your Business</span>
<p>Tax associate is a leading consultancy firm that provides <br> simple, effective company registration and accounting <br> solutions to enterprises in ireland.</p>
<a href="#" class="btn">Get Started</a>
</div>
<div class="main">
<div class="register">
<h3>Apply for Tax Rebate Now</h3>
<form action="" id="register" method="post">
<div class="wrapper">
<label for="" >Name</label>
<div>
<input type="text" name="name" id="">
</div>
<label for="" > Email ID</label>
<div>
<input type="text" name="email">
</div>
<label for=""> PPS Number</label>
<div>
<input type="text" name="Email" id="">
</div>
<a href="#" class="btn">Get Started</a>
</div>
</form>
</div>
</div>
</section>
2条答案
按热度按时间kqlmhetl1#
只需在每个输入中添加一个
margin-bottom
,除了最后一个:注意,输入应该始终有一个id,这样您就可以将标签连接到它,除非您将输入嵌套在标签中。
luaexgnf2#
您可以简单地将它们 Package 在一个
<div>
中,并根据您的需要为其给予一个类和样式。下面的例子html
CSS
我还建议做两件事来改进这段代码。首先,也是最重要的,分别为label和input分配
for
和id
属性。其次,div Package 输入似乎不必要。