Question

I'm newbie. And I try to make a search box. When I open it on Firefox. It's okay for me. Then I do it in IE, Chrome and Safari. It's not cool actually. Anyone know my problems, please help me fix it?

I want make a search box like this: http://www.behance.net/gallery/Anthracite-EIKON/7171451

<div id="search-box">
    <input type="text" name="search" placeholder="Search..."/>
</div>

And CSS:

*{ margin: 0; padding: 0;  }
#search-box{
  background: -moz-linear-gradient(top right, #353535, #010101);
  background: -webkit-linear-gradient(top right, #353535, #010101);
  background: -ms-linear-gradient(top right, #353535, #010101);
  background: -o-linear-gradient(top right, #353535, #010101);
  background: linear-gradient(top right, #353535, #010101);
  padding: 30px 0;
  position: relative;
}

input {
  font-family: Cambria, 'Helvetica Neue',​Helvetica,​Arial,​sans-serif;
  font-size: 14px;
  font-style: normal;
  font-variant: normal;
  color:  #bebebe;
  font-weight: 400;
  line-height: 56px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5) ;

  border-radius: 13px;
  border: 1px solid #000000;
  background-clip: border-box;
  padding: 5px 4px 3px 24px;
  width: 94px;
  height: 27px;
  box-shadow: 0 0 9px #121212 inset;
  position: absolute;
  right: 25px;
  top: 15;

  background-color: #444444 ;
  background-image: url('images/search_icon.png');
  background-repeat: no-repeat;
  background-size: 12px 12px;
  background-position: 9px 8px;
}

input:hover {
  box-shadow: none;
}

input:focus {
  width: 200px;
  box-shadow: none;
  text-shadow: none;
  color: #4D4E52;
  background-color: white ;
  background-image: url('images/search_icon5.png');
  background-repeat: no-repeat;
  background-position: 9px 8px;
}
Was it helpful?

Solution

In your css for input you need to change top:15 to top:15px and change line-height to 24px;

Example: http://jsfiddle.net/justincook/sMG3R/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top