搜索框页面实现

效果图


image.png

1.html


2.css

.searchBar{
    height: 30px;
    padding: 5px;
    position: relative;
}
.searchImg{
    display: inline-block;
    background-color: #f5f5f5;
    float: left;
    width: 30px;
    height: 30px;
    position: absolute;
}
.searchImg img {
    width: 16px;
    height: 16px;
    margin: 7px;
}
.search{
    padding: 5px 0px 5px 30px;
    background-color: #f5f5f5;
    line-height: 30px;
    height: 30px;
    border: none;
    box-sizing: border-box; 
    float: left;
    width: calc(100% - 40px);
    font-size: 13px;
    border-radius: 3px;
}
.search:focus { 
    outline: none;
    border: none;
}
.cancle{
    display: inline-block;
    height: 30px;
    line-height: 30px;
    width: 40px;
    float: left;
    text-align: center;
    font-size: 13px;
    color: cadetblue;
}

你可能感兴趣的:(搜索框页面实现)