{"id":1285,"date":"2017-03-20T18:15:34","date_gmt":"2017-03-20T12:45:34","guid":{"rendered":"https:\/\/www.wikitechy.com\/technology\/?p=1285"},"modified":"2018-11-01T12:06:42","modified_gmt":"2018-11-01T06:36:42","slug":"remove-border-outline-around-textinput-boxes","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/technology\/remove-border-outline-around-textinput-boxes\/","title":{"rendered":"How to remove border (outline) around text\/input boxes"},"content":{"rendered":"<h2 id=\"problem\"><span style=\"color: #000080;\"><strong><label class=\"label label-Warning\">PROBLEM:<\/label><\/strong><\/span><\/h2>\n<p>How to <span style=\"color: #000000;\"><strong>remove the orange or blue border<\/strong><\/span> (outline) around text\/input boxes? It only happens on Chrome to show that the input box is active.<\/p>\n<p>Here\u2019s the input <a href=\"https:\/\/www.wikitechy.com\/css\/\" target=\"_blank\" rel=\"noopener\">CSS<\/a> :<\/p>\n[pastacode lang=\u201dcss\u201d manual=\u201dinput%20%7B%0A%09%09%09%20%20%20%20background-color%3A%20transparent%3B%0A%09%09%09%20%20%20%20border%3A%200px%20solid%3B%0A%09%09%09%20%20%20%20height%3A%2020px%3B%0A%09%09%09%20%20%20%20width%3A%20160px%3B%0A%20%09%09%09%20%20%20color%3A%20%23CCC%3B%0A%09%09%09%7D%0A\u201d message=\u201dCss Code\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/]\n[ad type=\u201dbanner\u201d]\n<h2 id=\"solution-1\"><span style=\"color: #ff0000;\"><label class=\"label label-info\">SOLUTION 1:<\/label><\/span><\/h2>\n<p>This border is used to show that the element is focused (i.e. you can type in the input or press the button with Enter). You can remove it, though:<\/p>\n[pastacode lang=\u201dcss\u201d manual=\u201dtextarea%3Afocus%2C%20input%3Afocus%7B%0A%09%09%20%09%20%20%20outline%3A%20none%3B%0A%09%09%09%7D%0A\u201d message=\u201dCss Code\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/]\n<p>You may want to add some other way for users to know what element has <a href=\"https:\/\/www.wikitechy.com\/tutorials\/javascript\/how-to-detect-pressing-enter-or-keyboard-using-jquery\" target=\"_blank\" rel=\"noopener\">keyboard<\/a> focus though for usability.<\/p>\n<p><a href=\"https:\/\/www.wikitechy.com\/technology\/enable-reader-mode-chrome-android\/\" target=\"_blank\" rel=\"noopener\">Chrome<\/a> will also apply highlighting to other elements such as DIV\u2019s used as modals. To <span style=\"color: #000000;\"><strong>prevent the highlight<\/strong><\/span> on those and all other elements as well, you can do:<\/p>\n[pastacode lang=\u201dcss\u201d manual=\u201d*%3Afocus%20%7B%0A%20%20%20%20%09%09%09outline%3A%20none%3B%0A%09%09%09%7D%0A\u201d message=\u201dCss Code\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/]\n<h2 id=\"solution-2\"><span style=\"color: #ff0000;\"><label class=\"label label-info\">SOLUTION 2:<\/label><\/span><\/h2>\n[pastacode lang=\u201dcss\u201d manual=\u201dinput%3Afocus%20%7B%0Aoutline%3Anone%3B%0A%7D\u201d message=\u201dCss Code\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/]\n<h2 id=\"solution-3\"><span style=\"color: #ff0000;\"><label class=\"label label-info\">SOLUTION 3:<\/label><\/span><\/h2>\n<p>This will do.<span style=\"color: #000000;\"><strong> Orange outline<\/strong><\/span> won\u2019t show up anymore.<\/p>\n<p>Here is the solution :<\/p>\n[pastacode lang=\u201dcss\u201d manual=\u201d.form-control%3Afocus%20%7B%0A%20%20border-color%3A%20inherit%3B%0A%20%20-webkit-box-shadow%3A%20none%3B%0A%20%20box-shadow%3A%20none%3B%0A%7D%0A\u201d message=\u201dCss Code\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/]\n<h2 id=\"solution-4\"><span style=\"color: #ff0000;\"><label class=\"label label-info\">SOLUTION 4:<\/label><\/span><\/h2>\n<p>Use the following syntax to <span style=\"color: #000000;\"><strong>remove the border of text box<\/strong><\/span> and remove the highlighted border of browser style.<\/p>\n[pastacode lang=\u201dcss\u201d manual=\u201dinput%20%7B%0A%20%20%20%20background-color%3Atransparent%3B%0A%20%20%20%20border%3A%200px%20solid%3B%0A%20%20%20%20height%3A30px%3B%0A%20%20%20%20width%3A260px%3B%0A%7D%0Ainput%3Afocus%20%7B%0A%20%20%20%20outline%3Anone%3B%0A%7D%0A\u201d message=\u201dCss Code\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/]\n<h2 id=\"solution-5\"><span style=\"color: #ff0000;\"><label class=\"label label-info\">SOLUTION 5:<\/label><\/span><\/h2>\n<p>Try this code :<\/p>\n[pastacode lang=\u201dcss\u201d manual=\u201d%3Cinput%20style%3D%22border%3Anone%22%20%3E%0A\u201d message=\u201dCss Code\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/]\n<h2 id=\"solution-6\"><span style=\"color: #ff0000;\"><label class=\"label label-info\">SOLUTION 6:<\/label><\/span><\/h2>\n<p>This remove orange frame in <a href=\"https:\/\/www.wikitechy.com\/technology\/27-handy-chrome-os-commands-run-crosh\/\" target=\"_blank\" rel=\"noopener\">chrome<\/a> from all and any element no matter what and where is it<\/p>\n[pastacode lang=\u201dcss\u201d manual=\u201d*%3Afocus%20%7B%0A%09%09%09%09%20%20%20%20outline%3A%20none%3B%0A%09%09%09%09%7D%0A\u201d message=\u201dCss Code\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/]\n<p style=\"top: 106px;\">[ad type=\u201dbanner\u201d]\n<h2 id=\"solution-7\"><span style=\"color: #ff0000;\"><label class=\"label label-info\">SOLUTION 7:<\/label><\/span><\/h2>\n<p>Common for all tags:<\/p>\n[pastacode lang=\u201dcss\u201d manual=\u201d*%3Afocus%20%7B%0A%20%20%20%20outline%3A%20none%3B%0A%09%09%7D%0A\u201d message=\u201dCss Code\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/]\n<p>Specific to some tag, ex: input tag<\/p>\n[pastacode lang=\u201dcss\u201d manual=\u201dinput%3Afocus%20%7B%0A%09%09%20%20%20outline%3Anone%3B%0A%09%09%7D%0A\u201d message=\u201dCss Code\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/]\n<h2 id=\"solution-8\"><span style=\"color: #ff0000;\"><label class=\"label label-info\">SOLUTION 8:<\/label><\/span><\/h2>\n<p>When an input element set to focus in Web Kit <a href=\"https:\/\/www.wikitechy.com\/technology\/10-best-web-browsers-linux\/\" target=\"_blank\" rel=\"noopener\">browsers<\/a> like Safari and Chrome, the browser will put a blurry blue\/yellow border around it.<\/p>\n<p>This could be confusing and could make your design look different. To disable this we can use the following code.<\/p>\n[pastacode lang=\u201dcss\u201d manual=\u201d%2F*%20remove%20border%20around%20all%20input%20elements%20*%2F%0Ainput%3Afocus%20%7B%0A%20%20%20%20outline%3A%20none%3B%7D%0A%2F*%20remove%20border%20around%20all%20textarea%20elements%20*%2F%0Atextarea%3Afocus%20%7B%0A%20%20%20%20outline%3A%20none%3B%7D%0A%2F*%20remove%20border%20around%20all%20select%20elements%20*%2F%0Aselect%3Afocus%20%7B%0A%20%20%20%20outline%3A%20none%3B%7D%0A%2F*%20remove%20border%20around%20all%20input%2Ctextarea%20and%20select%20elements%20*%2F%0Ainput%3Afocus%2C%20textarea%3Afocus%2C%20select%3Afocus%20%7B%0A%20%20%20%20outline%3A%20none%3B%7D%0A%2F*%20remove%20border%20around%20all%20elements%20*%2F%0A%3Afocus%20%7B%0A%20%20%20%20outline%3A%20none%3B%7D%0A\u201d message=\u201dCss Code\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/]\n<h2 id=\"solution-9\"><span style=\"color: #ff0000;\"><label class=\"label label-info\">SOLUTION 9:<\/label><\/span><\/h2>\n[pastacode lang=\u201dcss\u201d manual=\u201d*%3Afocus%20%7B%0A%09%09%20%20%20%20outline%3A%200%3B%0A%09%09%7D%0A\u201d message=\u201dCss Code\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/]\n<p><span style=\"color: #000000;\"><strong>Note:<\/strong> <\/span>On focus Use outline:0 in spite of outline:none. It\u2019s valid and better practice.<\/p>\n<h2 id=\"solution-10\"><span style=\"color: #ff0000;\"><label class=\"label label-info\">SOLUTION 10:<\/label><\/span><\/h2>\n<p>you can also use:<\/p>\n[pastacode lang=\u201dcss\u201d manual=\u201dinput%3Afocus%7B%0A%09%09%20%20%20border%3A%20transparent%3B%0A%09%09%7D%0A\u201d message=\u201dCss Code\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/]\n<p style=\"top: 106px;\">[ad type=\u201dbanner\u201d]\n","protected":false},"excerpt":{"rendered":"<p>PROBLEM: How to remove the orange or blue border (outline) around text\/input boxes? It only happens on Chrome to show that the input box is active. Here\u2019s the input CSS : [pastacode lang=\u201dcss\u201d manual=\u201dinput%20%7B%0A%09%09%09%20%20%20%20background-color%3A%20transparent%3B%0A%09%09%09%20%20%20%20border%3A%200px%20solid%3B%0A%09%09%09%20%20%20%20height%3A%2020px%3B%0A%09%09%09%20%20%20%20width%3A%20160px%3B%0A%20%09%09%09%20%20%20color%3A%20%23CCC%3B%0A%09%09%09%7D%0A\u201d message=\u201dCss Code\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/] [ad type=\u201dbanner\u201d] SOLUTION 1: This border is used to show that the element is focused (i.e. you [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,24],"tags":[2486,2483,2484,2498,2494,2490,2489,2487,2496,2499,2488,2493,2492,2485,2491,2497,2495],"class_list":["post-1285","post","type-post","status-publish","format-standard","hentry","category-css","category-html","tag-css-how-to-remove-borders-around-textbox-when-adding-background","tag-css-how-to-remove-the-border-highlight-on-an-input-text-element","tag-css-remove-borders-around-html-input","tag-css-input-focus-border-color","tag-css-input-outline","tag-css-outline-color-property","tag-glowing-blue-input-highlights","tag-html-remove-the-border-when-focusing-on-an-input-box","tag-input-focus-css-glow","tag-remove-blue-border-on-click","tag-remove-border-from-field","tag-remove-border-from-input-type-text","tag-remove-focus-outline-css","tag-remove-input-box-border-using-css","tag-remove-shadowsborders-from-input-box","tag-remove-textbox-border-css","tag-textbox-without-border-in-html"],"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/1285","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/comments?post=1285"}],"version-history":[{"count":0,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/1285\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media?parent=1285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/categories?post=1285"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/tags?post=1285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}