10

i´m trying to remove the dropdown arrow with this following css, but it´s not making any effect.

enter image description here

.dropdown::after{
  display: none !important; 
}

here is the code

<NavDropdown className={classes.user} title="Componentes" id="collasible-nav-dropdown">
   <NavDropdown.Item href="#action/3.1">Action</NavDropdown.Item>
   <NavDropdown.Item href="#action/3.2">Another action</NavDropdown.Item>
   <NavDropdown.Item href="#action/3.3">Something</NavDropdown.Item>
   <NavDropdown.Divider />
   <NavDropdown.Item href="#action/3.4">Separated link</NavDropdown.Item>
</NavDropdown>
2

2 Answers 2

18

Here is the CSS from the Bootstrap dropdown arrow:
enter image description here

So in order to overwrite it you need to use the corresponding CSS selector:

.dropdown-toggle::after {
  display: none !important; 
}

Note that maybe there is no need to include the !important.

Sign up to request clarification or add additional context in comments.

2 Comments

How is the down arrow being specified? In the image you linked, it has content: "", but the empty string is somehow becoming a down arrow. I inspected the element but can't find any other ::after usages. Any idea what's going on?
@Nathan The triangle is created by the borders' properties, not by the content value. You can see the details of how it works in this article: css-tricks.com/snippets/css/css-triangle
0

Not sure if this is solved, I had a similar issue with select dropdown and it turns out the caret/arrow is a background-image and you can set it to background-image: none in CSS to remove it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.