{"id":112,"date":"2018-03-25T06:31:08","date_gmt":"2018-03-25T06:31:08","guid":{"rendered":"http:\/\/demos.codexcoder.com\/reveal\/globally-provide-access-to-mission-critical-synergy-for-2-copy-3-copy\/"},"modified":"2018-06-25T04:24:11","modified_gmt":"2018-06-25T04:24:11","slug":"globally-provide-access-to-mission-critical-synergy-for-2-copy-3-copy","status":"publish","type":"post","link":"https:\/\/demos.codexcoder.com\/reveal\/globally-provide-access-to-mission-critical-synergy-for-2-copy-3-copy\/","title":{"rendered":"How to Create Drop Down Menu with HTML and CSS"},"content":{"rendered":"<p>Today we\u2019re going to make a responsive dropdown menu with html and css and Jquery. Actually, I will use a little jquery code to create dropdown menu. I will show you how you can easily make a responsive dropdown menu. It\u2019s an open source project, so you can use it for your own project so let\u2019s start.<\/p>\n<p>You can see what you are want to make by clicking on view demo and see what happened.<\/p>\n<p><strong>Read Also:\u00a0<a href=\"https:\/\/www.codexcoder.com\/products\/top-news-newsmagazine-wordpress-theme\/\">A Brand New Multipurpose Theme That You Can Use for All Websites<\/a><\/strong><\/p>\n<p><strong><u>Table of Contents<\/u><\/strong><\/p>\n<ol>\n<li>Skip to the<a href=\"https:\/\/www.codexcoder.com\/how-to-create-drop-down-menu-with-html-and-css\/#html-structure\">\u00a0HTML<\/a><\/li>\n<li>Skip to the<a href=\"https:\/\/www.codexcoder.com\/how-to-create-drop-down-menu-with-html-and-css\/#css-structure\">\u00a0CSS<\/a><\/li>\n<li>Skip to the<a href=\"https:\/\/www.codexcoder.com\/how-to-create-drop-down-menu-with-html-and-css\/#js-structure\">\u00a0Jquery<\/a><\/li>\n<li>Skip to the<a href=\"https:\/\/www.codexcoder.com\/how-to-create-drop-down-menu-with-html-and-css\/#responsive\">\u00a0Responsive<\/a><\/li>\n<\/ol>\n<h2 id=\"html-structure\">1.HTML Structure<\/h2>\n<p>First of all, create html file.<\/p>\n<pre> &lt;!-- start mainmenu --&gt;\r\n &lt;section class=\"primary-menu\"&gt;\r\n    &lt;div class=\"container\"&gt;\r\n      &lt;!-- small device section --&gt;\r\n      &lt;div class=\"responsive-menu\"&gt;\r\n        &lt;span class=\"menu-btn\"&gt;\r\n          &lt;i class=\"fa fa-bars\"&gt;&lt;\/i&gt;\r\n        &lt;\/span&gt;\r\n      &lt;\/div&gt;\r\n        &lt;!-- end small device --&gt;\r\n\r\n        &lt;!-- start menu area --&gt;\r\n      &lt;div class=\"menu-area\"&gt;\r\n        &lt;ul class=\"menu\"&gt;\r\n          &lt;li&gt;&lt;a href=\"#\"&gt;Home&lt;\/a&gt;&lt;\/li&gt;\r\n          &lt;li&gt;&lt;a href=\"#\"&gt;Layout&lt;\/a&gt;&lt;\/li&gt;\r\n          &lt;li&gt;&lt;a href=\"#\"&gt;Our Course&lt;\/a&gt;\r\n            &lt;!-- start submenu --&gt;\r\n        &lt;ul class=\"submenu\"&gt;\r\n          &lt;li&gt;&lt;a href=\"#\"&gt;Web Development&lt;\/a&gt;&lt;\/li&gt;\r\n          &lt;li&gt;&lt;a href=\"#\"&gt;Graphic Design&lt;\/a&gt;&lt;\/li&gt;\r\n          &lt;li&gt;&lt;a href=\"#\"&gt;Search Engine Optimization&lt;\/a&gt;&lt;\/li&gt;\r\n        &lt;li&gt;&lt;a href=\"#\"&gt;Wordpress theme Development&lt;\/a&gt;&lt;\/li&gt;\r\n            &lt;\/ul&gt;&lt;!-- end submenu --&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li&gt;&lt;a href=\"#\"&gt;Online Tranning&lt;\/a&gt;&lt;\/li&gt;\r\n          &lt;li&gt;&lt;a href=\"#\"&gt;Blog&lt;\/a&gt;&lt;\/li&gt;\r\n          &lt;li&gt;&lt;a href=\"#\"&gt;Protfolio&lt;\/a&gt;&lt;\/li&gt;\r\n          &lt;li&gt;&lt;a href=\"#\"&gt;About Us&lt;\/a&gt;&lt;\/li&gt;\r\n        &lt;\/ul&gt;\r\n      &lt;\/div&gt;&lt;!-- end main menu area --&gt;\r\n    &lt;\/div&gt;\r\n  &lt;\/section&gt;\r\n  &lt;\r\n<\/pre>\n<h3>Menu Wrapper and Container<\/h3>\n<p>Create a menu wrapper named primary-menu class which is the parent class. You may use a background color whichever you want. The container used to bring the menu into 1140px. You must used max-width:1140px for a container in CSS.<\/p>\n<pre> &lt;section class=\"primary-menu\"&gt;\r\n     &lt;div class=\"container\"&gt;\r\n&lt;! -- For menu section   --&gt; \r\n      &lt;\/div&gt;\r\n&lt;\/section&gt;\r\n<\/pre>\n<h3>Unordered List<\/h3>\n<p>In this section, we make a simple menu for our project using ul tag (ul tag define as menu class).<\/p>\n<pre>&lt;ul class=\"menu\"&gt;\r\n  &lt;li&gt;&lt;a href=\"#\"&gt;Home&lt;\/a&gt;&lt;\/li&gt;\r\n  &lt;li&gt;&lt;a href=\"#\"&gt;Layout&lt;\/a&gt;&lt;\/li&gt;\r\n  &lt;li&gt;&lt;a href=\"#\"&gt;Our Course&lt;\/a&gt;&lt;\/li&gt;\r\n  &lt;li&gt;&lt;a href=\"#\"&gt;Online Training&lt;\/a&gt;&lt;\/li&gt;\r\n  &lt;li&gt;&lt;a href=\"#\"&gt;Blog&lt;\/a&gt;&lt;\/li&gt;\r\n  &lt;li&gt;&lt;a href=\"#\"&gt;Protfolio&lt;\/a&gt;&lt;\/li&gt;\r\n  &lt;li&gt;&lt;a href=\"#\"&gt;About Us&lt;\/a&gt;&lt;\/li&gt;\r\n&lt;\/ul&gt;\r\n<\/pre>\n<h3>Nested Dropdown Menu<\/h3>\n<p>Now create another unordered list into any li tag. Here create another unordered list using ul tag (ul tag define as submenu class) in our course li tag.<\/p>\n<pre>&lt;ul class=\"menu\"&gt;\r\n  &lt;li&gt;&lt;a href=\"#\"&gt;Home&lt;\/a&gt;&lt;\/li&gt;\r\n  &lt;li&gt;&lt;a href=\"#\"&gt;Layout&lt;\/a&gt;&lt;\/li&gt;\r\n  &lt;li&gt;&lt;a href=\"#\"&gt;Our Course&lt;\/a&gt;\r\n    \r\n&lt;! -- start submenu --&gt;\r\n    &lt;ul class=\"submenu\"&gt;\r\n      &lt;li&gt;&lt;a href=\"#\"&gt;Web Development&lt;\/a&gt;&lt;\/li&gt;\r\n      &lt;li&gt;&lt;a href=\"#\"&gt;Graphic Design&lt;\/a&gt;&lt;\/li&gt;\r\n      &lt;li&gt;&lt;a href=\"#\"&gt;Search Engine Optimization&lt;\/a&gt;&lt;\/li&gt;\r\n      &lt;li&gt;&lt;a href=\"#\"&gt;Wordpress theme Development&lt;\/a&gt;&lt;\/li&gt;\r\n    &lt;\/ul&gt;&lt;! -- End submenu --&gt;\r\n&lt;\/li&gt;\r\n\r\n  &lt;li&gt;&lt;a href=\"#\"&gt;Online Training&lt;\/a&gt;&lt;\/li&gt;\r\n  &lt;li&gt;&lt;a href=\"#\"&gt;Blog&lt;\/a&gt;&lt;\/li&gt;\r\n  &lt;li&gt;&lt;a href=\"#\"&gt;Protfolio&lt;\/a&gt;&lt;\/li&gt;\r\n  &lt;li&gt;&lt;a href=\"#\"&gt;About Us&lt;\/a&gt;&lt;\/li&gt;\r\n&lt;\/ul&gt;\r\n<\/pre>\n<h3>Responsive Menu<\/h3>\n<p>For responsive section, we take an extra div named responsive-menu for small devices. Especially, it\u2019s visible when the device has come.I\u2019ll show how when it shows and hidden and why it\u2019s happened later.<\/p>\n<pre>  &lt;div class=\"responsive-menu\"&gt;\r\n    &lt;span class=\"menu-btn\"&gt;\r\n      &lt;i class=\"fa fa-bars\"&gt;&lt;\/i&gt;\r\n    &lt;\/span&gt;\r\n  &lt;\/div&gt;\r\n\r\n<\/pre>\n<h2>2. Styling with CSS<\/h2>\n<p>After completing html structure, it\u2019s time to need styling. For styling, add file path<br \/>\nbetween head tag.<\/p>\n<p>[Since I was kept this file into assets folder inside of css folder, so used this (assets\/css\/style.css) path. You may change your path whatever you want]<\/p>\n<h3 id=\"css-structure\">Main StyleSheet<\/h3>\n<pre>\/* menu section *\/\r\n.primary-menu {\r\n    background: #29B899;\r\n    display: inline-block;\r\n    width: 100%;\r\n}\r\n    \/*main menu area*\/\r\n.menu-area{}\r\n.menu-area .menu{\r\n    list-style: none;\r\n    margin: 0;\r\n    padding: 0;\r\n    width: 100%;\r\n}\r\n.menu-area .menu li{\r\n    float: left;\r\n    position: relative;\r\n}\r\n.menu-area .menu li a {\r\n    text-decoration: none;\r\n    padding: 15px 20px;\r\n    display: inline-block;\r\n    color: #fff;\r\n    transition: all .3s ease;\r\n    line-height: 28px;\r\n    text-transform: uppercase;\r\n    font-size: 14px;\r\n    font-weight: 500;\r\n}\r\n.menu-area .menu li a:hover{\r\n    background: #fff;\r\n    color: #29B899;\r\n}\r\n        \/*end main menu area*\/\r\n\r\n        \/*start submenu*\/\r\n.menu-area .menu li .submenu {\r\n    position: absolute;\r\n    width: 300px;\r\n    background: #29B899;\r\n    list-style: none;\r\n    left: 0;\r\n    display: none;\r\n    margin: 0;\r\n    padding: 0;\r\n}\r\n.menu-area .menu li .submenu li {\r\n    display: block;\r\n    position: relative;\r\n    width: 100%;\r\n    border-bottom: 1px solid #e0d5d5;\r\n}\r\n.menu-area .menu li .submenu li a {\r\n    display: block;\r\n}\r\n.menu-area .menu li .submenu li a:hover{\r\n}\r\n    \/*end submenu*\/\r\n\r\n\/*to working dropdown menu*\/\r\n.menu-area .menu li:hover .submenu{\r\n    display: block;\r\n}\r\n  \/*  responsive option  *\/\r\n.responsive-menu{\r\n    display: none;\r\n}\r\nspan.menu-btn{\r\n    display: block;\r\n    padding: 15px 15px;\r\n    color: #fff;\r\n    display:inline-block;\r\n}\r\n\r\n\/* responsive menu for small device*\/\r\n@media  (max-width: 768px) {\r\n.header-section{\r\n    width: 100%;\r\n    }\r\n    \/* hidden the large menu *\/\r\n.menu-area {\r\n    display: none;\r\n    }\r\n    \/*enable responsive menu*\/\r\n.responsive-menu{\r\n    display: block;\r\n    }\r\n\r\n    \/*styling menu area*\/\r\n.menu-area .menu li a{\r\n    color: #29B899;\r\n}\r\n.menu-area .menu li {\r\n    float: left;\r\n    position: relative;\r\n    width: 100%;\r\n    text-align: center;\r\n    background: #fff;\r\n    border-bottom: 1px solid #e8e8e8;\r\n}\r\n}\r\n.empty{\r\n    padding: 200px 0px;\r\n}\r\n<\/pre>\n<h3>Styling Primary Menu and Container<\/h3>\n<p>Fixed a color of your menu and set max-width 100%.<\/p>\n<h3>Styling Unordered List<\/h3>\n<pre>  \/* primary menu *\/\r\n .primary-menu {\r\n    background: #29B899;\r\n    display: inline-block;\r\n    width: 100%;\r\n}\r\n<\/pre>\n<p>We want to keep the menu section between 1140px and middle of the section so for this<\/p>\n<pre>.container{\r\n   max-width: 1140px;\r\n   margin: auto;\r\n}\r\n<\/pre>\n<p>By adding a menu-area parent class, we style this menu section.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we\u2019re going to make a responsive dropdown menu with html and css and Jquery. Actually, I will use a little jquery code to create dropdown menu. I will show you how you can easily make a responsive dropdown menu. It\u2019s an open source project, so you can use it for your own project so [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":146,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-112","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/posts\/112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/comments?post=112"}],"version-history":[{"count":2,"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/posts\/112\/revisions"}],"predecessor-version":[{"id":172,"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/posts\/112\/revisions\/172"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/media\/146"}],"wp:attachment":[{"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/media?parent=112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/categories?post=112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/tags?post=112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}