admin管理员组文章数量:1426894
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 remendations. Thanks
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 remendations. Thanks
1 Answer
Reset to default 5They 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" autoplete="off" init="true" value="hello w"/>
本文标签: javascriptMultiple font colors in an Input tagStack Overflow
版权声明:本文标题:javascript - Multiple font colors in an Input tag - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745488466a2660493.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论