Results 1 to 2 of 2

Thread: Any Link CSS question

  1. #1
    Join Date
    Feb 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Any Link CSS question

    Script URL: http://www.dynamicdrive.com/dynamici...anylinkcss.htm

    This is the horizontal menu script.
    When hover over a link which is using this script, a menu pops up where the subcategories are lined one below the other.

    Is it possible to align the subcategories one beside the other?


    So instead of being like this:

    {mouse-hover on the link}
    |sub1|
    |sub2|
    |sub3|

    I was hoping for something like this:

    {mouse-hover on the link}
    |sub1||sub2||sub3|

    Any help would be greatly appreciated!
    Thanks!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Sure, use these styles in anylink.css in place of the ones that come with the menu:

    Code:
    .anylinkcss{
    position:absolute;
    visibility: hidden;
    border:1px solid black;
    font:normal 12px Verdana;
    line-height: 18px;
    z-index: 100;
    background-color: #E9FECB;
    width: auto;
    padding:0 10px;
    }
    
    .anylinkcss a{
    width: 100%;
    text-indent: 3px;
    padding: 1px 0;
    text-decoration: none;
    font-weight: bold;
    text-indent: 5px;
    }
    
    .anylinkcss a:hover{ /*hover background color*/
    background-color: black;
    color: white;
    }
    Be sure not to specify a width in the HTML in the body for the anylinkcss class division. This is OK:

    Code:
    <div id="anylinkmenu1" class="anylinkcss">
    This is not:

    Code:
    <div id="anylinkmenu2" class="anylinkcss" style="width: 150px; background-color: lightyellow">
    If you want dividers between the subs, just hard code them, ex:

    Code:
    <a href="http://www.dynamicdrive.com/">Dynamic Drive</a> | <a href="http://www.cssdrive.com">CSS Drive</a> | 
    <a href="http://www.javascriptkit.com">JavaScript Kit</a> | <a href="http://www.codingforums.com">Coding Forums</a> | 
    <a href="http://www.javascriptkit.com/jsref/">JavaScript Reference</a>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •