Get rid of the dashed outline surrounding the selected button

One of my divs has a button inside that, when clicked, creates an outline around it. Here is what it looks like:

https://i.sstatic.net/pEr53.png

**Code: **

.slide-arrow {
  color: #fff;
  background-color: #9E9997;
  border: none;
  padding: 16px 10px 17px 10px;
  font-size: 25px;
  opacity: 0.5;
  outline: 0;
}

.slide-arrow-right {
  position: absolute;
  top: 50%;
  right: 0%;
  transform: translate(0%, -50%);
  -ms-transform: translate(0%, -50%);
  margin-right: -1px;
  border-bottom-left-radius: 4px;
  border-top-left-radius: 4px;
}

.slide-arrow-left {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(0%, -50%);
  -ms-transform: translate(-0%, -50%);
  border-bottom-right-radius: 4px;
  border-top-right-radius: 4px;
}

.slide-arrow:hover {
  opacity: 0.7;
}

.slide-arrow:active {
  background-color: #D47C7C;
}

.slide-arrow i {
  font-size: 32px;
  outline: 0 !important;
}

.slide-arrow i:focus {
  outline: 0 !important;
}
<button class="slide-arrow slide-arrow-right" onclick="plusDivs(1)"><i class="fa fa-angle-double-right"></i></button>

I am looking to remove this feature. Even after using outline: 0 !important; on various elements, the issue persists specifically in Firefox.

Answer №1

One key aspect is its significance for accessibility as it highlights the currently selected or clicked element. Therefore, it is advisable not to delete it.

In case you still wish to eliminate it, you can insert the following snippet into your stylesheet:

:focus {
  outline: none !important;
}

Answer №2

To remove the outline, apply outline: none to the specific tag when the button is in the :active or :focus state.

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

Is there a problem with the way divs are being displayed when using jQuery to show the first 12 elements with the class "hide-show"?

I am encountering a problem with displaying data using the jQuery slice() and show() methods to reveal dynamically generated divs from a PHP function. The code is as follows: <style> .hide-show { display :none; } </style> <div class="c ...

The issue with importing fonts in CSS causing an error is encountered when utilizing an exported Angular library

I have a components library for Angular that relies on line-awesome icons. To include the necessary fonts and styles, I am using a CDN in the main SCSS file as shown below: @import url('https://fonts.googleapis.com/css2?family=Nunito:wght@200;300;400; ...

Swap out the content within the selected element

Let's imagine we have the following shopping list: export default { data() { return { items: { Apple, Orange, Appricot } } } } <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js" ...

Superceding Meta Character Encoding Statements

Have you ever wondered what happens when two older-style character encoding declarations are used in a webpage? Will the first declaration override the second, or vice versa? Or will they both be ignored and excluded from the encoding algorithm? For Ex ...

Is it possible for a memory leak to occur when a jQuery object is created within a function but never actually used?

As an illustration: function calculateTime(minutes) { var newTime = new Date(); newTime.setHours(0, minutes, 0, 0); return angular.element('<input type="hidden"/>').timepicker('setTime', newTime).val(); } I'm cu ...

One common issue is being unable to target input[type=file] when multiple forms are present on a page using JavaScript

Question: I have multiple dynamic forms on a web page, each with a file input field. How can I specifically target the correct file input using $(this) in JavaScript? Here is an example of one of my forms: <form enctype="multipart/form-data" action="c ...

Generating Javascript code with PHP and handling quotes successfully

After encountering an issue with apostrophes causing errors in my PHP-generated HTML, I found a solution that involved using the addslashes() function. Here is the code snippet: <?php $lines = array(); $lines[] = "I am happy"; $lines[] = "I'm hap ...

Deactivate the button until the input meets validation criteria using Angular

What I'm trying to achieve is to restrict certain input fields to only accept integer or decimal values. Here's the code snippet that I currently have: <input type="text" pattern="[0-9]*" [(ngModel)]="myValue" pInputText class="medium-field" ...

the hidden input's value is null

I am encountering an issue with a hidden input in this form. When I submit the form to my API, the value of the input is empty. Isbn and packId are both properties of a book model. However, for some reason, the value of packId is coming out as empty. & ...

What could be the reason for my application not utilizing its bootstrap classes effectively?

Just starting out with Bootstrap and have made some progress. However, the bootstrap classes I'm using are not rendering properly. What could be the issue? <div class="position-absolute bottom-0 end-0 border border-dark"> https://i.ss ...

What is the best way to identify the full URL along with the querystring?

While using a web application on Firefox, I encounter an issue where clicking on a button redirects me to a different page and processes query string parameters that are hidden in the URL. Can anyone suggest tools that can help me identify these query str ...

A pair of floating divs sandwiching a stretchy div in the middle

I am looking to achieve a fixed width header with specific layout requirements: A left-aligned div of variable width. A right-aligned div of variable width. An h2 element centered between the two divs, adjusting its size based on available space. The co ...

Create a log table specifically for tracking changes made to the drop-down menu

I need to create a Change log table that will track any changes made in the drop-down menu. For instance, I am working on a worksheet with a select menu called Results which includes options like Positive, Negative, Unknown. I want the system to log any ch ...

Inaccurate rendering of border widths on IOS platform

After setting the border width of these input boxes to 1px, it appears that on iOS devices, the top border seems larger than intended (regardless of the browser being used). Interestingly, on any other type of device, the border looks perfectly fine. & ...

Creating a dynamic animation effect on a div with a changing number of child elements

Currently, I am utilizing the nganimate library and have implemented an animation that affects the max-height property of a div. Here is a snippet of my code: CSS .sublist.ng-hide { max-height: 0; } .sublist { max-height: 1300px; overflow: hidden; ...

`Prepare and load all materials in advance`

Question: On my page, I have a slideshow displaying images and videos. Before starting the slideshow, I want to ensure that all content on the page has loaded. Does $(window).load() verify if all content, including videos, has been loaded? Thanks in adv ...

Enhancing the performance of jquery selection speed

I am currently working on a code that manipulates the HTML code of an asp.net treeview. Since this code runs frequently, I need to ensure that it executes with maximum speed. I am interested in expanding my knowledge on jQuery selectors and optimizing th ...

Activate the display by utilizing the getElementsByClassName method

In my design, I'd like to have the "Don't have an account?" line trigger the display of the .registrybox class when clicked. However, the script I've written doesn't seem to be working as intended. The script is meant to hide the .login ...

Display or conceal toggle in ruby utilizing jQuery

I'm facing an issue with the functionality of a button that is meant to hide and show a form using jQuery. Initially, I added a path to signup in the button so that it would display and function properly. Now, when I click the button, the form shows u ...

My approach to using this style in React involves utilizing the class attribute as follows: "class[attribute]" [Updated version 2]

When trying to customize an element based on its attribute, the process is a bit different in React compared to pure CSS. Here's an example: <div class='something' data-test='4'></div> ... .something[data-test] { bac ...