gpt4 book ai didi

html - 如何在我的 div 之间提供间距/填充

转载 作者:太空宇宙 更新时间:2023-11-03 20:25:37 26 4
gpt4 key购买 nike

我有 3 个输入框,我想在它们之间填充。我不明白在哪里放置填充。 Link to codepen

我有 3 个输入框。

@import url(https://fonts.googleapis.com/css?family=Montserrat);
body {
display: inline-block;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
font-family: Montserrat;
background: #313E50;
}

.text-input {
position: relative;
margin-top: 50px;
display: inline-block;
}

.text-input input[type="text"] {
display: inline-block;
width: 300px;
height: 40px;
box-sizing: border-box;
outline: none;
border: 1px solid lightgray;
border-radius: 3px;
padding: 10px 10px 10px 100px;
transition: all 0.1s ease-out;
}

.text-input input[type="text"]+label {
position: absolute;
top: 0;
left: 0;
bottom: 0;
height: 40px;
line-height: 40px;
color: white;
border-radius: 3px 0 0 3px;
padding: 0 20px;
background: #E03616;
-webkit-transform: translateZ(0) translateX(0);
transform: translateZ(0) translateX(0);
transition: all 0.3s ease-in;
transition-delay: 0.2s;
}

.text-input input[type="text"]:focus+label {
-webkit-transform: translateY(-120%) translateX(0%);
transform: translateY(-120%) translateX(0%);
border-radius: 3px;
transition: all 0.1s ease-out;
}

.text-input input[type="text"]:focus {
padding: 10px;
transition: all 0.3s ease-out;
transition-delay: 0.2s;
}
<div class="text-input">
<input type="text" id="input1" placeholder="Try typing something in here!">
<label for="input1">Name</label>
</div>
<div class="text-input">
<input type="text" id="input1" placeholder="Try typing something in here!">
<label for="input1">Name</label>
</div>
<div class="text-input">
<input type="text" id="input1" placeholder="Try typing something in here!">
<label for="input1">Name</label>
</div>

最佳答案

.text-input上添加margin-right

.text-input{
position: relative;
margin-top: 50px;
display: inline-block;
margin-right: 50px;/*Add This*/

https://codepen.io/anon/pen/GLzJvM

关于html - 如何在我的 div 之间提供间距/填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55867989/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com