{"id":1550,"date":"2019-10-22T18:55:26","date_gmt":"2019-10-22T18:55:26","guid":{"rendered":"https:\/\/www.withinweb.com\/info\/?p=1550"},"modified":"2019-10-22T18:55:26","modified_gmt":"2019-10-22T18:55:26","slug":"bootstrap-4-navbar-make-rollover","status":"publish","type":"post","link":"https:\/\/www.withinweb.com\/info\/bootstrap-4-navbar-make-rollover\/","title":{"rendered":"Bootstrap 4 NavBar make Rollover for DropDown Navigation and Clickable Top Link"},"content":{"rendered":"<p>This explains how to change the default <strong>Bootstrap 4 NavBar<\/strong> so that any drop down is activated by a mouse rollover rather than an on-click.\u00a0 It also shows how to change the top level navigation link to be clickable.<\/p>\n<p>The default behaviour of the Bootstrap 4 navigation is any drop down has to be clicked for the drop down to work.\u00a0 The Bootstrap version that I am currently using is version 4.3 which you can see at:<\/p>\n<p>https:\/\/getbootstrap.com\/docs\/4.3\/components\/navbar\/#supported-content<\/p>\n<p>If you look at the given example, part of the navbar is the drop down code:<\/p>\n<pre><code class=\"language-html\" data-lang=\"html\"> <span class=\"nt\">&lt;li<\/span> <span class=\"na\">class=<\/span><span class=\"s\">\"nav-item dropdown\"<\/span><span class=\"nt\">&gt;<\/span>\r\n        <span class=\"nt\">&lt;a<\/span> <span class=\"na\">class=<\/span><span class=\"s\">\"nav-link \r\n                  dropdown-toggle\"<\/span> \r\n<span class=\"na\">                  href=<\/span><span class=\"s\">\"#\"<\/span> \r\n<span class=\"na\">                  id=<\/span><span class=\"s\">\"navbarDropdown\"<\/span> \r\n<span class=\"na\">                  role=<\/span><span class=\"s\">\"button\"<\/span> \r\n<strong><span class=\"na\">                  data-toggle=<\/span><span class=\"s\">\"dropdown\"<\/span> <\/strong>\r\n<span class=\"na\">                  aria-haspopup=<\/span><span class=\"s\">\"true\"<\/span> \r\n<span class=\"na\">                  aria-expanded=<\/span><span class=\"s\">\"false\"<\/span><span class=\"nt\">&gt;<\/span>\r\n          Dropdown\r\n        <span class=\"nt\">&lt;\/a&gt;<\/span>\r\n        <span class=\"nt\">&lt;div<\/span> <span class=\"na\">class=<\/span><span class=\"s\">\"dropdown-menu\"<\/span> <span class=\"na\">aria-labelledby=<\/span><span class=\"s\">\"navbarDropdown\"<\/span><span class=\"nt\">&gt;<\/span>\r\n          <span class=\"nt\">&lt;a<\/span> <span class=\"na\">class=<\/span><span class=\"s\">\"dropdown-item\"<\/span> <span class=\"na\">href=<\/span><span class=\"s\">\"#\"<\/span><span class=\"nt\">&gt;<\/span>Action<span class=\"nt\">&lt;\/a&gt;<\/span>\r\n          <span class=\"nt\">&lt;a<\/span> <span class=\"na\">class=<\/span><span class=\"s\">\"dropdown-item\"<\/span> <span class=\"na\">href=<\/span><span class=\"s\">\"#\"<\/span><span class=\"nt\">&gt;<\/span>Another action<span class=\"nt\">&lt;\/a&gt;<\/span>\r\n          <span class=\"nt\">&lt;div<\/span> <span class=\"na\">class=<\/span><span class=\"s\">\"dropdown-divider\"<\/span><span class=\"nt\">&gt;&lt;\/div&gt;<\/span>\r\n          <span class=\"nt\">&lt;a<\/span> <span class=\"na\">class=<\/span><span class=\"s\">\"dropdown-item\"<\/span> <span class=\"na\">href=<\/span><span class=\"s\">\"#\"<\/span><span class=\"nt\">&gt;<\/span>Something else here<span class=\"nt\">&lt;\/a&gt;<\/span>\r\n        <span class=\"nt\">&lt;\/div&gt;<\/span>\r\n      <span class=\"nt\">&lt;\/li&gt;<\/span><\/code><\/pre>\n<p>To allow mouse rollover, add in the following styles as follows:<\/p>\n<pre>&lt;style&gt;\r\n.dropdown:hover .dropdown-menu {\r\ndisplay: block;\r\n}\r\n&lt;\/style&gt;<\/pre>\n<p>Now remove the line <strong>data-toggle=&#8221;dropdown&#8221;<\/strong>\u00a0 in the dropdown code which will make the top link clickable.<\/p>\n<p>So that should be that.\u00a0 Now a mouse rollover will cause the drop down to appear, and the top link is clickable.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This explains how to change the default Bootstrap 4 NavBar so that any drop down is activated by a mouse rollover rather than an on-click.\u00a0 It also shows how to change the top level navigation link to be clickable. The<span class=\"ellipsis\">&hellip;<\/span><\/p>\n<div class=\"read-more\"><a href=\"https:\/\/www.withinweb.com\/info\/bootstrap-4-navbar-make-rollover\/\">Read more <span class=\"screen-reader-text\">Bootstrap 4 NavBar make Rollover for DropDown Navigation and Clickable Top Link<\/span><span class=\"meta-nav\"> &#8250;<\/span><\/a><\/div>\n<p><!-- end of .read-more --><\/p>\n","protected":false},"author":53,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,14],"tags":[],"class_list":["post-1550","post","type-post","status-publish","format-standard","hentry","category-general-php","category-site-design"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Bootstrap 4 NavBar make Rollover for DropDown Navigation and Clickable Top Link - PHP Web Applications<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.withinweb.com\/info\/bootstrap-4-navbar-make-rollover\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bootstrap 4 NavBar make Rollover for DropDown Navigation and Clickable Top Link - PHP Web Applications\" \/>\n<meta property=\"og:description\" content=\"This explains how to change the default Bootstrap 4 NavBar so that any drop down is activated by a mouse rollover rather than an on-click.\u00a0 It also shows how to change the top level navigation link to be clickable. The&hellip;Read more Bootstrap 4 NavBar make Rollover for DropDown Navigation and Clickable Top Link &#8250;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.withinweb.com\/info\/bootstrap-4-navbar-make-rollover\/\" \/>\n<meta property=\"og:site_name\" content=\"PHP Web Applications\" \/>\n<meta property=\"article:published_time\" content=\"2019-10-22T18:55:26+00:00\" \/>\n<meta name=\"author\" content=\"Paul Gibbs\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Paul Gibbs\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/bootstrap-4-navbar-make-rollover\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/bootstrap-4-navbar-make-rollover\\\/\"},\"author\":{\"name\":\"Paul Gibbs\",\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/#\\\/schema\\\/person\\\/b4df539cfb6debde6d0373daadfeb470\"},\"headline\":\"Bootstrap 4 NavBar make Rollover for DropDown Navigation and Clickable Top Link\",\"datePublished\":\"2019-10-22T18:55:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/bootstrap-4-navbar-make-rollover\\\/\"},\"wordCount\":158,\"commentCount\":0,\"articleSection\":[\"General PHP\",\"Site Design\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.withinweb.com\\\/info\\\/bootstrap-4-navbar-make-rollover\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/bootstrap-4-navbar-make-rollover\\\/\",\"url\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/bootstrap-4-navbar-make-rollover\\\/\",\"name\":\"Bootstrap 4 NavBar make Rollover for DropDown Navigation and Clickable Top Link - PHP Web Applications\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/#website\"},\"datePublished\":\"2019-10-22T18:55:26+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/#\\\/schema\\\/person\\\/b4df539cfb6debde6d0373daadfeb470\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/bootstrap-4-navbar-make-rollover\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.withinweb.com\\\/info\\\/bootstrap-4-navbar-make-rollover\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/bootstrap-4-navbar-make-rollover\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bootstrap 4 NavBar make Rollover for DropDown Navigation and Clickable Top Link\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/\",\"name\":\"PHP Web Applications\",\"description\":\"Information and support for products of WithinWeb.com\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/#\\\/schema\\\/person\\\/b4df539cfb6debde6d0373daadfeb470\",\"name\":\"Paul Gibbs\",\"sameAs\":[\"http:\\\/\\\/www.withinweb.com\"],\"url\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/author\\\/azpg27\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Bootstrap 4 NavBar make Rollover for DropDown Navigation and Clickable Top Link - PHP Web Applications","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.withinweb.com\/info\/bootstrap-4-navbar-make-rollover\/","og_locale":"en_US","og_type":"article","og_title":"Bootstrap 4 NavBar make Rollover for DropDown Navigation and Clickable Top Link - PHP Web Applications","og_description":"This explains how to change the default Bootstrap 4 NavBar so that any drop down is activated by a mouse rollover rather than an on-click.\u00a0 It also shows how to change the top level navigation link to be clickable. The&hellip;Read more Bootstrap 4 NavBar make Rollover for DropDown Navigation and Clickable Top Link &#8250;","og_url":"https:\/\/www.withinweb.com\/info\/bootstrap-4-navbar-make-rollover\/","og_site_name":"PHP Web Applications","article_published_time":"2019-10-22T18:55:26+00:00","author":"Paul Gibbs","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Paul Gibbs","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.withinweb.com\/info\/bootstrap-4-navbar-make-rollover\/#article","isPartOf":{"@id":"https:\/\/www.withinweb.com\/info\/bootstrap-4-navbar-make-rollover\/"},"author":{"name":"Paul Gibbs","@id":"https:\/\/www.withinweb.com\/info\/#\/schema\/person\/b4df539cfb6debde6d0373daadfeb470"},"headline":"Bootstrap 4 NavBar make Rollover for DropDown Navigation and Clickable Top Link","datePublished":"2019-10-22T18:55:26+00:00","mainEntityOfPage":{"@id":"https:\/\/www.withinweb.com\/info\/bootstrap-4-navbar-make-rollover\/"},"wordCount":158,"commentCount":0,"articleSection":["General PHP","Site Design"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.withinweb.com\/info\/bootstrap-4-navbar-make-rollover\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.withinweb.com\/info\/bootstrap-4-navbar-make-rollover\/","url":"https:\/\/www.withinweb.com\/info\/bootstrap-4-navbar-make-rollover\/","name":"Bootstrap 4 NavBar make Rollover for DropDown Navigation and Clickable Top Link - PHP Web Applications","isPartOf":{"@id":"https:\/\/www.withinweb.com\/info\/#website"},"datePublished":"2019-10-22T18:55:26+00:00","author":{"@id":"https:\/\/www.withinweb.com\/info\/#\/schema\/person\/b4df539cfb6debde6d0373daadfeb470"},"breadcrumb":{"@id":"https:\/\/www.withinweb.com\/info\/bootstrap-4-navbar-make-rollover\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.withinweb.com\/info\/bootstrap-4-navbar-make-rollover\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.withinweb.com\/info\/bootstrap-4-navbar-make-rollover\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.withinweb.com\/info\/"},{"@type":"ListItem","position":2,"name":"Bootstrap 4 NavBar make Rollover for DropDown Navigation and Clickable Top Link"}]},{"@type":"WebSite","@id":"https:\/\/www.withinweb.com\/info\/#website","url":"https:\/\/www.withinweb.com\/info\/","name":"PHP Web Applications","description":"Information and support for products of WithinWeb.com","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.withinweb.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.withinweb.com\/info\/#\/schema\/person\/b4df539cfb6debde6d0373daadfeb470","name":"Paul Gibbs","sameAs":["http:\/\/www.withinweb.com"],"url":"https:\/\/www.withinweb.com\/info\/author\/azpg27\/"}]}},"_links":{"self":[{"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/posts\/1550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/users\/53"}],"replies":[{"embeddable":true,"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/comments?post=1550"}],"version-history":[{"count":15,"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/posts\/1550\/revisions"}],"predecessor-version":[{"id":1567,"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/posts\/1550\/revisions\/1567"}],"wp:attachment":[{"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/media?parent=1550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/categories?post=1550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/tags?post=1550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}