Hi
I am making a search bar. I have taken and pasted form a ot of different sources. The result is that is displays the search-sign icon outside of the search field.
Please let me know how to get that bugger inside of the serach field. It is now hovering outside it like the image shows:
Code is like this:
<section class="container">
<label for="search_bar">Search </label>
<input class="search_bar"
name="search_bar"
type="search"
placeholder="Search">
<a href="#">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20px" height="20px" viewBox="375.045 607.885 30.959 30.33" enable-background="new 375.045 607.885 30.959 30.33" xml:space="preserve">
<path fill="#494949" d="M405.047,633.805l-7.007-6.542c-0.129-0.121-0.267-0.226-0.408-0.319c1.277-1.939,2.025-4.258,2.025-6.753 c0-6.796-5.51-12.306-12.307-12.306s-12.306,5.51-12.306,12.306s5.509,12.306,12.306,12.306c2.565,0,4.945-0.786,6.916-2.128 c0.122,0.172,0.257,0.337,0.418,0.488l7.006,6.542c1.122,1.048,2.783,1.093,3.709,0.101 C406.327,636.507,406.169,634.853,405.047,633.805z M387.351,629.051c-4.893,0-8.86-3.967-8.86-8.86s3.967-8.86,8.86-8.86 s8.86,3.967,8.86,8.86S392.244,629.051,387.351,629.051z"/>
</svg>
</a>
</section>
CSS:
@import url(https://fonts.googleapis.com/css?family=Open+Sans:300);
*, *:before, *:after{
box-sizing: border-box;
font: 300 1em/1.5 'Open Sans', 'Helvetica Neue', Arial, sans-serif; color: #666;
padding: 0; margin: 0;
}
html, body{background: rgb(236, 240, 241);}
section.container{
width: 40%;
min-width: 300px;
margin: 20% auto;
}
label{display: none;}
input.search_bar{
border: none; outline: none;
width: 75px;
border-radius: 55px;
margin: 0 auto;
font-size: 2em; color: #0d2840;
padding: 25px 70px 25px 35px;
transition: all .3s cubic-bezier(0,0,.5,1.5);
box-shadow: 0 3px 10px -2px rgba(0,0,0,.1);
background: rgb(255, 255, 255) url(https://i.imgur.com/seveWIw.png) no-repeat center center;
}
input.search_bar:focus{width: 100%; background-position: calc(100% - 35px) center}
/*Removes default x in search fields (webkit only i guess)*/
input[type=search]::-webkit-search-cancel-button{-webkit-appearance: none;}
/*Changes the color of the placeholder*/
::-webkit-input-placeholder{color: #0d2840; opacity: .5;}
:-moz-placeholder{color: #0d2840; opacity: .5;}
::-moz-placeholder{color: #0d2840; opacity: .5;}
:-ms-input-placeholder{color: #0d2840; opacity: .5;}