Provide zblog template_zblog them_wordpress template download and customization

Color change reminder effect code when the search box/input box in the webpage is clicked to input text

Tianxing Studio 2015-04-11 23:51 course eleven thousand and twenty-nine 0 Comments


Since everyone has different ways of understanding and saying this, let's first use a picture to explain what the effect of this article is:

 Search box/input box in the webpage, click to enter text, color change, reminding effect code, special effect code, search box, tutorial page 1

This is a search box. The normal style is the above style. When website When visitors mouse over the search box to enter text, it will become the following style, which is more striking.

PS: This thing is purely personal. It uses the pseudo class in css. Firefox, Google and IE11 have passed the test. Other browsers have not been tested. Please understand before using. Upper code.

Html part:

 <div class="ss"> <form action="{$host}zb_system/cmd.php?act=search" method="post" name="frmsearch" id="frmsearch"> <input name="q" id="edtSearch" class="input" size="12" type="text" value="Please enter the keyword" onfocus="this. value='';" onblur="if (this. value=='') {this. value='Please enter the search keyword '}"><input value="Search" name="btnPost" id="btnPost" type="submit"> </form></div>

Css part:

 .nav .ss{position:relative;} .ss #edtSearch{height:30px;width: 240px;border: 1px solid #919191;font-size:14px;background-color: #535353;background-image: url(img/sshui.png);background-repeat: no-repeat;background-position: right 0px;margin-top: 6px;padding-left: 5px;line-height: 30px;color: #919191;} .ss #edtSearch:focus{background-color:#e2e2e2;background-image: url(img/sshui.png);background-repeat: no-repeat;background-position: right -32px;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-left-width: 0px;height:32px;} .ss #btnPost{cursor:pointer;position:absolute;top:6px;width:30px;height:30px;text-indent:-999em;right: 0px;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-left-width: 0px;background-color: transparent;}

Use two search icons to make one of your own. If you have any questions, you can exchange them on the comment page of this article.


Can't find a tutorial that can solve your problem?

You can try to search or ask questions directly online. We also provide charging technical support. If you need it, you can contact us online.

Online questions Online Service

Related recommendations

welcome you Comment: Cancel Reply

 Please fill in the verification code
  • Latest articles
  • Hot article ranking
  • Most Comments
Label aggregation
  • Sign in
  • Registered account Forgot your password?
  • register
  • Already have an account? Direct login Forgot your password?
  • Social account login