html

changing a horizontal list to vertical  #angularjs #reactjs

  • For your parent nav
      style (should probably style it by id) you will need to remove the overflow: hidden; to allow the submenu to display, and add an :after style as a clearfix to clear the first level of floated

    • ‘s
    • So you can add class=”parent” to parent list items and put as submenus.
    • The first step is to put your “Services” ul inside the “services” li tag.
    • should also use the id for styling the main nav ( #nav-bars ) to avoid messing up other
        ‘s that might appear on the page.
      • Next add position: relative; to your
      • so you can position the submenu off of it

      So I am working on a website and want to know How I can convert the drop down list to be vertical. At the moment it’s clunked up together horizontally. here is the code. I want to make the list in “services” to be a drop down list.
      Html

      @ng_real_ninja: changing a horizontal list to vertical #angularjs #reactjs

      So I am working on a website and want to know How I can convert the drop down list to be vertical. At the moment it’s clunked up together horizontally. here is the code. I want to make the list in “services” to be a drop down list. Html

      ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #BCD4E6; } li { float: left; } @font-face { font-family: “NavFont”; src: url(“NavFont.ttf”); } li a { display: block; color: orange; text-align: center; padding: 14px 16px; text-decoration: none; } a{ font-family: NavFont; font-size: 20px; text-decoration:none; } li a:hover { background-color: #ACE5EE; } #registaration{ position:relative; bottom:200px; left:1300px; } #Login{padding:4px;} #Signup{padding:4px;} body{ overflow-x:hidden; } #services li{ }

      To achieve this, you will first have to put your submenu for services nested inside its parent nav item.

      ‘s

      #nav-bars { list-style-type: none; margin: 0; padding: 0; background-color: #BCD4E6; } #nav-bars:after { content: ”; display:block; clear: both; }

      li { float: left; position: relative; }

      li.dropdown:hover > ul { display: block } #nav-bars > li.dropdown > ul { display:none; position: absolute; top: 100%; left: 0; list-style-type: none; margin: 0; padding: 0; background-color: #BCD4E6 }

      #nav-bars > li.dropdown > ul > li { float: none; }

      ul { list-style-type: none; margin: 0; padding: 0; background-color: #BCD4E6; } ul:after { content: ”; display:block; clear: both; } li { float: left; position: relative; } li:hover > ul { display: block } ul > li > ul { display:none; position: absolute; top: 100%; left: 0; } ul > li > ul > li { float: none; } @font-face { font-family: “NavFont”; src: url(“NavFont.ttf”); } li a { display: block; color: orange; text-align: center; padding: 14px 16px; text-decoration: none; } a { font-family: NavFont; font-size: 20px; text-decoration: none; } li a:hover { background-color: #ACE5EE; } #registaration { position: relative; bottom: 200px; left: 1300px; } #Login { padding: 4px; } #Signup { padding: 4px; } body { overflow-x: hidden; height: 100%; } #services li {}

      ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #BCD4E6; } li { float: left; } @font-face { font-family: “NavFont”; src: url(“NavFont.ttf”); } li a { display: block; color: orange; text-align: center; padding: 14px 16px; text-decoration: none; } a { font-family: NavFont; font-size: 20px; text-decoration:none; } li a:hover { background-color: #ACE5EE; } #registaration { position:relative; bottom:200px; left:1300px; } #Login { padding:4px; } #Signup { padding:4px; } body { overflow-x:hidden; } .dropdown { display: none; top: -9999em; position: absolute; width: 180px; } .parent:hover .dropdown { display: block; top: auto; } #services li { display: block; padding: 10px 15px; }

      html

You might also like More from author

Comments are closed, but trackbacks and pingbacks are open.