Results 1 to 4 of 4

Thread: Making a drop down menu

  1. #1
    Join Date
    Feb 2014
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Making a drop down menu

    How should a drop down menu be brought into the center of a page, yet it should ease out to the left after the browser has been minimized. The menu has been made inside a division and it looks like something like this:
    Code:
    <div  id="cssmenu" >
      <ul>
    <li><a href="#">Home</a></li>
    <li><a href="#">Blog</a></li>
    <li><a href="#">About</a></li>
    <li class='active has-sub'><a href="#">Services</a>
    <ul>
    <li><a href="#">Services</a></li>
    <li class='has-sub'>
    <a href="#">Service 1</a>
    <ul class='has-sub'>
    <li><a href="#">A Service</a></li>
    <li><a href="#">Another Service</a></li>
    </ul>
    </li>
    <li><a href="#">Service 2</a></li>
    </ul> 
    </li>
    <li><a href="#">Contact</a></li>
    </ul>
    </div>
    The CSS file has been attached.
    Attached Files Attached Files
    Last edited by Beverleyh; 04-23-2015 at 03:06 PM. Reason: formatting

  2. #2
    Join Date
    Jan 2009
    Location
    NH
    Posts
    675
    Thanks
    98
    Thanked 26 Times in 26 Posts

    Default

    change the #cssmenu #cssmenu-button to this
    Code:
    #cssmenu #menu-button {
      margin: 0 auto;
      padding: 0;
      border: 0;
      list-style: none;
      line-height: 1;
      display: table;
      position: relative;
      -webkit-box-sizing: border-box;
      -moz-box-sizing: border-box;
      box-sizing: border-box;
    }

  3. #3
    Join Date
    Jan 2009
    Location
    NH
    Posts
    675
    Thanks
    98
    Thanked 26 Times in 26 Posts

    Default

    In the <head> of your html you should add this to help with mobile friendly or smaller devices, tablets, etc
    Code:
    <meta name="viewport" content="width=device-width, initial-scale=1" />

  4. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Your CSS already includes the facility to centre the desktop menu - it looks like the relevant "align-center" class has been removed from the markup at some point, so just add it back;
    Code:
    <div id="cssmenu" class="align-center">
    Last edited by Beverleyh; 04-23-2015 at 08:40 PM. Reason: Corrected class name
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

Similar Threads

  1. Making changes to Drop Down Tabs menu system
    By nickgray in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 01-25-2013, 06:32 PM
  2. Making the Drop Down Script Remote
    By bman in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 07-14-2007, 10:29 AM
  3. AnyLink Drop Down Menu - Making original link work
    By protyne in forum Dynamic Drive scripts help
    Replies: 7
    Last Post: 03-31-2006, 05:54 AM
  4. Making AnyLink Drop Down Menu DROP UP
    By jtarabay in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 11-30-2005, 02:10 PM
  5. Replies: 6
    Last Post: 09-30-2004, 04:02 AM

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
  •