I can’t figure out what’s causing the blank space between the submit button and the input area of the searchbox.
http://i.imgur.com/q4Dqz.png
html:
<form method="get" id="searchform" action="<?php bloginfo('url'); ?>">
<p><input type="text" class="field" name="s" id="s" placeholder="Search" />
<input type="submit" class="submit" name="submit" value="Traži" /></p>
css:
#searchform {
float: right;
padding-top: 10px;
position: relative;
}
header input#s {
margin: 0;
border: none;
height: 29px;
width: 250px;
}
header input:active {
border: none;
}
header input.submit {
border: none;
height: 30px;
width: 30px;
margin: 0;
text-indent: -99999px;
background: white url(images/search.png) 0 0 no-repeat;
padding-right:20px;
}
http://jsfiddle.net/butuzov/MCtc3/
use font-size:0 for parent element (p in your case) or avoid space between input element
This is one from the most frequently questions, it’s very important to have a nice search bar with a good look,
you did a nice work ,but the best way to create a better search bar is like that, follow me step by step it will helps you a lot, the look you want in a short time :
you create the form tag and inside you create a div with class expl : searchBarContainer
inside your div you create an input:text and button don’t use input:btn
// now you have a form / div / input text and button
now we have the structure and we need just a style for our form it looks ugly right ? of course it is, so :
}
in this code dyplay flex all that you need to focus on :
display : flex;
felx : 1;
And last for the button style :
Final Result