I'm trying to use angular-ui bootstrap accordion to hold bootstrap table inside the heading. When user clicks on the accordion heading and it opens, a strange outline appears. It looks like this (the light blue rectangle around "Some title"):
I understand it happens because I used the <div>
, but how can I eliminate this behavior?
The code is:
<accordion close-others="true">
<accordion-group>
<accordion-heading>
<div>Some title</div>
</accordion-heading>
Text
</accordion-group>
<accordion-group>
<accordion-heading>
<div>Another title</div>
</accordion-heading>
</accordion-group>
</accordion>
If you are using bootstrap accordion and want that one of the accordion should be opened for the first time so add class="in" .
Just add data-toggle="collapse" and a data-target to the element to automatically assign control of one or more collapsible elements. The data-target attribute accepts a CSS selector to apply the collapse to. Be sure to add the class collapse to the collapsible element.
Just add data-toggle="collapse" and a data-target to element to automatically assign control of a collapsible element. The data-target attribute accepts a CSS selector to apply the collapse to. Be sure to add the class collapse to the collapsible element. If you'd like it to default open, add the additional class in.
The outline is added to the panel-heading panel-title <a> tag
, which has an .accordion-toggle
class. So, to avoid the *
catch-all selector you can do this:
.accordion-toggle:focus{outline: none;}
With this solution there is no need for !important either (so you'll respect the devs who come after you).
outline
is a shorthand property whose only required value is outline-style
. In this case I am setting outline-style
to none
.
This is a great article that explains specificity, if you're not convinced that !important should be avoided in all but a couple of cases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With