Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Menu Bars & CSS

  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    85
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Menu Bars & CSS

    Hey,

    I'm building a vertical menu in CSS. All the links are in an unordered list. The top slice of the menu bar directly above the links is an image.

    Should I:

    A) Set it up so the first <li> of the unordered list contains the img?

    or

    B) Place a div directly above the unordered list with the img in it?

    What'd you do??

  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Um, I'd probably put the menu in a div, set the background image of the div to the one you want, and add a top margin to the menu to bring the menu items below it.

    eg.

    <div id="menudiv">
    <ul class="menulist">
    <li>First Item</li>
    <li>Second Item</li>
    <li>Third Item</li>
    </ul>
    </div>

    #menudiv { background: url(image.jpg) top center no-repeat; }
    ul.menulist { margin-top: 30px; }


  •  

    Posting Permissions

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