Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the color of the upward arrow on an open dropdown-menu

I'm working with twitter bootstrap 2.0.1

I'm trying to change the color of the dropdown-menu.

I have managed to change the color of the container that is comming down itself, however I can't seem the find where the arrow is comming from.

Anyone know where I can find the code where the arrow comes from (and how to change it's color)?

examle

like image 737
Siebe Avatar asked Feb 17 '12 13:02

Siebe


People also ask

How do you change the color of the drop down arrow in CSS?

If you want to change the select dropdown arrow color in CSS, you can use the ::after selector. This will allow you to change the color of the arrow without affecting the rest of the element. You can also use the :hover selector to change the color of the arrow when the user hovers over the element.

How do I change the position of a dropdown arrow in CSS?

There is no special pseudo elements for select dropdown icon in css. But you can change the position of the icon by background property. Or else use this kind of "height" or "line-height" for good look.

Why dropdown opens upwards?

This is happening because may be you don't have space on your screen below the dropdown when you select first time. When you select first item, it shows the pannel below it with makes more space available below your dropdown and that is why in second time your dropdown opens downward.


1 Answers

The arrow code can be found on line:2690 of the bootstrap.css. You can manipulate its position and color by modifying its css, e.g.:

.navbar .dropdown-menu:after {
  content: '';
  display: inline-block;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #000; /* change color here, modified for a black arrow */
  position: absolute;
  top: -6px;
  left: 10px;
}
like image 73
Andres Ilich Avatar answered Oct 04 '22 16:10

Andres Ilich