I came across this helpful post and attempted various methods to adjust the padding for my placeholder text, but unfortunately, it seems unwilling to cooperate.
Below is the CSS code. (EDIT: This CSS was generated from SASS)
#search {
margin-top: 1px;
display: inline;
float: left;
margin-left: 10px;
margin-right: 10px;
width: 220px;
}
#search form {
position: relative;
}
#search input {
padding: 0 10px 0 29px;
color: #555555;
border: none;
background: url('/images/bg_searchbar.png?1296191141') no-repeat;
width: 180px;
height: 29px;
overflow: hidden;
}
#search input:hover {
color: #00ccff;
background-position: 0px -32px;
}
And here's the basic HTML structure:
<div id="search">
<form>
<input type="text" value="" placeholder="Search..." name="q" autocomplete="off" class="">
</form>
<div id="jquery-live-search" style="display: block; position: absolute; top: 15px; width: 219px;">
<ul id="search-results" class="dropdown">
</ul>
</div>
</div>
Seems straightforward, right? The placeholder text is not aligned correctly, and adjusting the padding for the input element messes up the design! It appears that only the color (for webkit
) of the placeholder can be modified. Frustrating!
Here are screenshots showing the placeholder text and the input field with typed text:
EDIT:
To temporarily resolve this issue, I've turned to using this jQuery plugin.
It's working perfectly and has fixed the problem in Chrome. However, I still want to understand what's causing this issue (potentially Chrome-specific, as John Catterfeld didn't face any problems on Windows). Any insights on why this is happening on both my client's Chrome and mine would be greatly appreciated!