-2

I want to add a right arrow for my sub menus (similar to ddsmoothmenu):

enter image description here

My sub menus have a class sub-menu.

Here is my code

<div id="centeredmenu">
<ul>
<li><a href='#'>Cat1</a></li>
<li><a href='#'>Cat2</a></li>
<li><a href='#'>Cat3</a>
    <ul class='sub-menu'>
       <li><a href="#">Sub Category</a></li>
       <li><a href="#">Sub Category</a></li>
    </ul>
</li>
</ul>
</div>

How can I add an arrow besides "Cat3"?

33_____________
  • 45
  • 1
  • 1
  • 10

2 Answers2

1

that arrow is basically an image which is set as background for those <li>s where you need it with no-repeat and right 0 property

for example

MARK-UP

<ul>
   <li class="arrow"></li>
   <li></li>
</ul>

CSS

li.class{
   background:#000000 url(/path/to/arrow.jpg) no-repeat right 0;
}

now only for first element the arrow will be visible

RbG
  • 3,181
  • 3
  • 32
  • 43
0

You can apply css for that select your li as below,

#centeredmenu > ul li{
   background:url(../img/arrow.png) right center;
}

Comment Response

Fiddle Demo

Devang Rathod
  • 6,650
  • 2
  • 23
  • 32