What is the best way to eliminate the focus border using a vendor prefix?

I'm currently working on a responsive website using Bootstrap 4, but I'm struggling to remove all outlines when clickable elements are clicked. Despite my attempts with the following code snippet, it doesn't seem to work:

*,
*:focus {
   outline: none !important;
   -webkit-outline: none !important;
   -moz-outline: none !important;
   -ms-outline: none !important;
   -o-outline: none !important;
}

Since I do utilize borders in my design, I'd prefer not to use border: none.

Attached is a screenshot of how the site appears on my mobile device (iPhone XR) running Chrome: https://i.sstatic.net/ppCCs.jpg

Answer №1

Alright, to tackle this, we need to dive deeper into HTML and CSS. Bootstrap typically utilizes box-shadow to create this border-like effect.

To resolve this issue, you can override the existing box-shadow property that has been applied, and you should see positive results.

For instance:

/* Original CSS code from bootstrap */

.form-control:focus {
  color: #495057;
  background-color: #fff;
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
}
<div class="input-group mb-3">
  <div class="input-group-prepend">
    <span class="input-group-text" id="basic-addon1">@</span>
  </div>
  <input type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="basic-addon1">
</div>

If simply removing the box-shadow did not do the trick, feel free to reach out in a comment for further assistance.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The Label method in the Html helper does not display the id

The creation of the checkbox and its label was done using an HTML helper: @Html.CheckBoxFor(m=>m[i].checkExport) @Html.LabelFor(m=>m[i].checkExport) To customize the label, I added the following CSS in a separate file: input[type="checkbox"] + l ...

Elements that are positioned in a single line in a text

I am experimenting with a layout where each item is displayed in a single line, with the width of the items determined by their content. The desired output looks like this: Intended result: (This feature is only supported in modern browsers) .item { ...

Embedding a thread in an HTML document (Difficult task)

I'm currently working on a method to achieve the following task: Embedding a specific string (such as "TEST") into the content of an HTML page, after every certain number of words (let's say 10). The challenge here is ensuring that the word count ...

What is the process for translating a single line of code from jQuery to vanilla JavaScript?

How should the code block $('#output').on('input ','.dynamic-Qty', function(e){ be handled? $('#output').on('input ','.dynamic-Qty', function(e){ let z = e.target.dataset; console.log(z.id) conso ...

Is it possible to use a figure tag as a fancybox link?

I am curious, is it possible to turn a figure tag into a fancybox link with just a background image and no content? I understand that this may not be recommended, but I am wondering if it can actually be achieved? <figure class="appear"><a class= ...

Save modified content in CKEditor to an HTML document

Currently, I am utilizing the Ajax success function to dynamically load the content from an HTML file into CKeditor. function retrieveFileContent(fileUrl) { $.ajax({ url: fileUrl, success: function (data){ ...

What is the best way to ensure that the button's left margin matches the left margin of the table at all times?

https://i.sstatic.net/qJwvE.png Hello there, I am currently working with HTML/CSS and I have managed to center a table on my page using the CSS class .tablecenter { margin-left:auto; margin-right:auto; } Following the table, I have placed a button: ...

merging inline scripts within the <head> section

I have the following code snippet in my HTML file and am looking for ways to optimize its loading process. <script type="text/javascript"> function downloadJSAtOnload() { var element1 = document.createElement("script"); element1.src = "js/jque ...

Incorporating text sections into a div container and adjusting the width

Currently facing an issue with the canvas element on my project. <div id="app-container"> <div id="canvas-container"> <div id="canvas"></div> </div> </div> In the CSS stylesheet, the following styles ar ...

What is causing nested divs to generate a scrollbar?

I am struggling with a situation involving 3 layers of nested divs: <div class="outer"> <div class="inner"><div class="item"></div></div> </div> In this scenario, the .inner div is set to position absolute and each d ...

After reloading the AJAX content, TinyMCE has been deactivated

Our team has recently implemented TinyMCE 5 in a project, and I must say, it has been quite a challenge. The editable content for a specific item is loaded within a Bootstrap 4 modal dialog. Once the modal dialog is loaded, TinyMCE is initialized for a tex ...

Problem with jQuery's .prepend method being called twice on list items

Looking to enhance the appearance of a list by adding some icons before the anchor links within each list item. <ul class="submenu-children"> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> ...

Step-by-step guide to positioning an iframe with 'transform:scale' on the left side

Recently, I encountered an issue with an iframe in my project. Initially, without any 'transform:scale' css applied, it displayed on the top-left side of the div as expected. However, after adding -webkit-transform:scale(0.6,1); margin-left:0.0e ...

The functionality of the Ajax code is taking an unusually long time

After running my Ajax code, it took a surprising 3 minutes and 15 seconds to load. What could be causing this delay? <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.j ...

Unable to fetch data from Django Template (.html) in my views

I'm a beginner in the world of Django and I'm currently working on a project that involves managing learning objects metadata. One of the essential functions of the system is to display the L.O. metadata directly in the web browser. Within my HT ...

Positioning a text field and a button adjacent to each other within the same row

My challenge is to consistently position a textfield and a button side by side. The requirement is for the button to always be on the right side of the screen, while the textfield should take up the remaining width on the left side. I initially tried setti ...

Toggle class on element based on presence of class on another element

If I have 4 boxes and the user is required to choose one. I aim to assign an active class to the box that the user clicks on. However, if the user selects another box, I want to remove the class from the first clicked box and apply it to the newly clicked ...

Issues with autoplay not functioning in Chrome browser with Youtube iframe source

I have added an iframe code to my simple HTML page. I would like the video to autoplay when the page loads. It works perfectly in Firefox, but in Chrome, the autoplay feature does not work. Here is my code: <iframe width="420" height="345" src="https:/ ...

Ways to declare a function within the events onMouseOver and onMouseOut

<div align="right" style="border:1 #FF0 solid; background-color:#999" onMouseOver="javascript: function(){this.style.backgroundColor = '#DDD';}" onMouseOut="javascript: function(){this.style.backgroundColor = '#999';}"> Register & ...

Exploring the world of web scraping using R's XML package with the powerful xpathS

I need help extracting the names of shopping malls from a specific website. The URL is provided here: After examining the html code, I noticed that the mall names are stored under the "h5" tag. I tried to extract the text using the following codes, but it ...