Results 1 to 3 of 3

Thread: how to make the class="selected" work inClean Arrow Underline Menu

  1. #1
    Join Date
    Mar 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how to make the class="selected" work inClean Arrow Underline Menu

    1) CSS Library: Horizontal CSS Menus: Clean Arrow Underline Menu

    2) http://www.dynamicdrive.com/style/cs...nderline_menu/

    3) Hi dynamic drive team...
    Could you please point me in the right direction for
    making the arrow show when adding the class "selected" (either in li or a:active)
    Code:
    <ul class="arrowunderline"
     <li> <a href="#"><b>test</b>Concept</a></li>
     <li class="selected"><a href="#"><b>test</b>Community</a></li>
     <li><a href="#"><b>test</b>Partner</a></li>
    </ul>
    thanks a ton in advance

    din

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Sure, use the below modified version of the code, which supports a CSS class of "selected" that can be inserted into a particular menu link to always show the underline arrow underneath that item. Changes in red:

    Code:
    <style>
    
    ul.arrowunderline{
    list-style-type:none;
    margin:0;
    padding:0;
    text-align:center; /* enter "left", "right", or "center" to orient the menu accordingly */
    font: bold 16px Georgia;
    }
    
    ul.arrowunderline li{
    display:inline;
    margin-right:25px; /* spacing between each menu item */
    }
    
    ul.arrowunderline li a{
    position:relative;
    color:black;
    padding-bottom:8px; /*spacing between each menu item and arrow underline beneath it */
    text-decoration:none;
    
    }
    
    ul.arrowunderline li a:hover, ul.arrowunderline li a.selected{
    border-bottom:3px solid purple; /* style of arrow underline */
    }
    
    ul.arrowunderline li a:hover:after, ul.arrowunderline li a.selected:after{ /* use CSS generated content to add arrow to the menu */
    content:'';
    width:0;
    height:0;
    position:absolute;
    left:50%;
    margin-left:-5px; /* value should match border-width below */
    bottom: 0;
    border-width:5px; /* value should match margin-left above */
    border-style:solid;
    border-color: transparent transparent purple transparent; /* create up arrow */
    }
    
    </style>
    
    
    <body>
    
    <ul class="arrowunderline">
    <li><a href="http://www.dynamicdrive.com">Home</a></li>
    <li><a href="http://www.dynamicdrive.com/new.htm" class="selected">New</a></li>
    <li class="selected"><a href="http://www.dynamicdrive.com/revised.htm">Revised</a></li>
    <li><a href="http://tools.dynamicdrive.com">Tools</a></li>
    <li><a href="http://tools.dynamicdrive.com/style/">CSS</a></li>	
    <li><a href="http://www.dynamicdrive.com/forums/">Forums</a></li>	
    </ul>
    DD Admin

  3. #3
    Join Date
    Mar 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thanks

    Hi ddadmin
    Thank you so much for your fast help
    your example works like a charm..
    cheers
    din

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •