I'm trying to add a triangle on the "active" element on the menu. I've added this css:

.navbar .active::after {
	content: "";
	position: absolute;
	bottom: -16px;

	border-width: 0px 15px 15px;
	border-style: solid;
	border-color: #ffffff transparent;
	display: block;
	width: 0;
}

But for some reason I'm getting 2 triangles slightly ontop of eachother on active elements as per attached screenshot. I don't know how else to get it right....please help?

CommentFileSizeAuthor
Screen Shot 2013-11-12 at 9.20.51 PM.png10.82 KBhmartens
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andregriffin’s picture

It's probably because there are two nested elements, both with the .active class, such as the li and the a tag. You need to be more specific on which one you are applying CSS to. you should probably use .navbar > .active:after or .navbar a.active:after or .navbar li.active:after.

hmartens’s picture

Oh wow thanks andregriffen!

It turned out that .navbar a.active:after worked perfect ;)

You're my hero of the day ;) I appreciate it sooooo much!

markhalliwell’s picture

Component: Code » Documentation
Status: Active » Closed (works as designed)