gpt4 book ai didi

html - 如何在一行中放置两个带边距的文本字段?

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

我试图通过在 .inline 类中应用 float: left; 属性,将两个输入字段放在一行中。

但是,因为所有 input[type="text"] 都有一个 margin: 5px;,它只适用于 width: 50% 仅当我删除边距时。

边距为 5:

Image 1

没有任何边距:

enter image description here

什么是理想的解决方案?

这是代码笔链接:http://codepen.io/biskotaki/pen/YXdYYE?editors=110

最佳答案

input[type="text"]
{
box-sizing: border-box;
padding: 5px;
width: 100%;
}

.inline input {
float: left;
width: calc(50% - 10px);
margin:5px;
}

http://fiddle.jshell.net/fL0gm3h9/

关于html - 如何在一行中放置两个带边距的文本字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31772707/

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