Skip to content Skip to sidebar Skip to footer

Multiple Font Colors In An Input Tag

I'm curious as to how Google's instant search feature maintains two separate font colors within a single input[type=text] element. Black for the user input and gray for the recomme

Solution 1:

They simply overlay another <div> at the same location. Fire up Firebug, IE Dev Tools or whatever and look for the <div> with id='grey'.

<div style="position: relative; background-image: none; background-attachment: scroll; background-repeat: repeat; background-position-x: 0%; background-position-y: 0%; background-color: transparent;">
  <div class="lst" id="grey" style="padding-left: 7px; white-space: nowrap;">
    Text - hello world
  <div class="lst" id="misspell"/>
<div class="lst" style="left: -9000px; top: -900px; width: auto; overflow: hidden; position: absolute; max-width: 3000px;">
  Text - hello w
<input name="q" title="Search" class="lst" type="text" maxLength="2048" autocomplete="off" init="true" value="hello w"/>

Post a Comment for "Multiple Font Colors In An Input Tag"