前端一行放两个input对齐问题

本文分享了在CSS中如何精确设置元素的高度、宽度、边框、内边距等属性,通过具体代码示例展示了如何实现不同元素间的无缝对接,如输入框与按钮的完美对齐。特别强调了在不同设备上保持一致性的方法,尤其是在移动端的表现。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

直接贴部分代码
.inputTwo{
height: .7rem;
width: 68%;
border-radius: .3rem;
border: none;
text-indent: .3rem;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
line-height: .7rem;
font-size: .27rem;
padding: 0px!important;
}
.inputThree{
height: .7rem !important;
width: 22%;
border: none;
border-radius: .2rem;
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
line-height: .7rem;
color: white;
background-color: #10c3fd;
font-size: .27rem;
padding: 0px!important;
}

![效果图](https://img-blog.csdnimg.cn/20191217152847419.png) 当然这是电脑上看的,与手机上看不一致,亲测各种苹果手机和安卓手机,重点是padding: 0px!important;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值