image.png
    index.html

    1. <!-- 搜索 -->
    2. <div class="search-wrap">
    3. <!-- wrap 是容器的意思 -->
    4. <div class="search-btn"></div>
    5. <div class="search">
    6. <div class="jd-icon"></div>
    7. </div>
    8. <div class="search-login">登录</div>
    9. </div>

    index.css

    /* 搜索 */
    .search-wrap {
      position: relative;
      overflow: hidden;
      height: 44px;
    }
    
    .search-wrap .search-btn {
      position: absolute;
      top: 0;
      left: 0;
      width: 40px;
      height: 44px;
    }
    
    .search-wrap .search-btn::before {
      content: "";
      margin: 14px 0 0 15px;
      display: block;
      width: 20px;
      height: 18px;
      background: url(../images/s-btn.png);
      background-size: 20px 18px;
    }
    
    .search-wrap .search {
      position: relative;
      height: 30px;
      background-color: skyblue;
      margin: 7px 50px;
      border-radius: 15px;
    }
    
    .search-wrap .search .jd-icon {
      position: absolute;
      top: 8px;
      left: 15px;
      width: 20px;
      height: 15px;
      background: url(../images/jd.png);
      background-size: 20px 15px;
    }
    
    .search-wrap .search .jd-icon::after {
      content: "";
      position: absolute;
      display: block;
      width: 1px;
      height: 16px;
      top: 0;
      right: -8px;
      background-color: #ccc;
    }
    
    .search-wrap .search-login {
      position: absolute;
      top: 0;
      right: 0;
      width: 40px;
      height: 44px;
      line-height: 44px;
      text-align: center;
      color: #fff;
    }