adding search icon to input box

后端 未结 3 1065
天涯浪人
天涯浪人 2021-02-04 05:39
3条回答
  •  闹比i
    闹比i (楼主)
    2021-02-04 06:12

    Put the image into the span, for example using background-image, then give it a relative position and move it to the left so it overlaps the right end of the search box, for example:

    #g-search-button {
      display: inline-block;
      width: 16px;
      height: 16px;
      position: relative;
      left: -22px;
      top: 3px;
    
      background-color: black;  /* Replace with your own image */
    }
    

    Working example on JSBin

    Note: This is not my answer, i've found it here

提交回复
热议问题