Search
 
SCRIPT & CODE EXAMPLE
 

CSS

add icon to input field

input {
    background-image: url(./JavaScript.png);
    background-position: 7px 7px;
    background-repeat: no-repeat;
  background-size: 20px 20px;
}
Comment

add icon to input

<!-- If using Bootstrap -->
<!-- Icon can be put before or after input -->
<div class="input-group mb-3">
  <span class="input-group-text" id="basic-addon1">
  	<!-- Icon or Text here -->
  </span>
  <input type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="basic-addon1">
  <span class="input-group-text" id="basic-addon1">
  	<!-- Icon or Text here -->
  </span>
</div>

<!-- Pure Css & Html -->
<!-- src: https://stackoverflow.com/a/40261155 -->
<style type="text/css">
  #input_container {
    position:relative;
    padding:0 0 0 20px;
    margin:0 20px;
    background:#ddd;
    direction: rtl;
    width: 200px;
  }
  #input {
      height:20px;
      margin:0;
      padding-right: 30px;
      width: 100%;
  }
  #input_img {
      position:absolute;
      bottom:2px;
      right:5px;
      width:24px;
      height:24px;
  }
</style>
<div id="input_container">
    <input type="text" id="input" value>
    <img src="https://cdn4.iconfinder.com/data/icons/36-slim-icons/87/calender.png" id="input_img">
</div>
Comment

how to add icon in input button

<button class="btn btn-warning" type="reset">
    <i class="fa fa-times"></i> Clear
</button>
Comment

how to add icon to input field

background: url(images/comment-author.gif) no-repeat scroll 7px 7px;
padding-left:30px;
Comment

show icon in input field

background: url(images/comment-author.gif) no-repeat scroll 7px 7px;
padding-left:30px;
Comment

PREVIOUS NEXT
Code Example
Css :: Disable text selection/highlight 
Css :: input type file without button 
Css :: gradient text colors 
Css :: circle css w3schools 
Css :: color code css 
Css :: bootstrap media query 
Css :: horizontal line css before and after heading 
Css :: Link design like a Button" 
Css :: how to add css using nativeelement in angular 
Css :: css float top 
Css :: css for disabled button 
Css :: how to align border to center in css 
Css :: transition delay only for specific property 
Css :: css percentrage minus px 
Css :: media query for mobile min and max width both 
Css :: box-shadow in css 
Css :: css border-left 
Css :: input type file placeholder 
Css :: media min height css 
Css :: ion-split-pane width 
Css :: drop down menu html css 
Css :: css flex bottom 
Css :: css how to hyperlink 
Css :: how to make fixed position responsive 
Css :: how to center icon vertically in react js 
Css :: add profile picture to a form in html and css 
Css :: add tailwindcss to angular 
Css :: css code examples 
Css :: margin bottom 
Css :: difference between pseudo elements and pseudo classes 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =