小程序搜索布局
程序员文章站
2022-03-25 13:49:00
...
wxml
<view class='searchBox'>
<view class='search'>
<icon size='15' type='search' class='searchIcon'></icon>
<input class='searchInput' type='text' placeholder='请输入关键字'></input>
</view>
</view>
wxss
.searchBox{
height: 100rpx;
width: 100%;
position: relative;
padding: 20rpx 0;
box-sizing: border-box;
}
.search{
display: flex;
width: 75%;
margin: 0 auto;
height: 60rpx;
line-height: 60rpx;
border: 1px solid #ddd;
border-radius: 30rpx;
background: #fff;
}
.searchIcon{
padding: 15rpx 30rpx 0 15rpx;
box-sizing: border-box;
}
.searchInput{
width: 80%;
height: 100%;
padding: 5rpx;
box-sizing: border-box;
}
上一篇: 前端路由的实现原理解析
下一篇: shell学习 - 处理脚本的多参数输入