How do the various browsers handle input [type="search"] and add a clearing button? And how can that be reset to implement a custom clearing button?
-
I was creating a search function on a website where I added a custom button. The "button" was a input[type="reset"] that had a custom size and background image. In firefox it looked fine But in chrome a clear button was added. And in Safari, search input gets rounded and a button added. ignore the border radius on the reset. I removed it when testing in other browsers later.
-
Answer:
Chrome and Safari use webkit. So this worked for both browsers to get rid of the default button. ::-webkit-search-cancel-button { -webkit-appearance: none; } In production I have various search features so I had to use the appropriate CSS selector to only select the input[type="search"] in the appropriate divs. To get rid of the rounded border in Safari I added these rules to affect that search input. outline: none;-webkit-appearance: none;
Juan Gallardo at Quora Visit the source
Other answers
I found following links very helpful: http://jsbin.com/sejuquta/1/edit http://jsfiddle.net/Q7fRB/1/
Tanmay Rajani
Related Q & A:
- How can I get rid of the "Get IE7 now!" button on the Yahoo Toolbar?Best solution by Yahoo! Answers
- How do I add a "HOME" button?Best solution by User Experience
- How can I add a picture to a video?Best solution by Answerbag.com
- How can I type in Korean on a regular keyboard?Best solution by ipa.typeit.org
- How can I add an attachment to a message?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.