{"id":654,"date":"2015-03-31T22:20:19","date_gmt":"2015-03-31T22:20:19","guid":{"rendered":"https:\/\/www.megamenu.com\/?page_id=654"},"modified":"2019-09-20T12:20:34","modified_gmt":"2019-09-20T11:20:34","slug":"adjust-sub-menu-width","status":"publish","type":"ht_kb","link":"https:\/\/www.megamenu.com\/documentation\/adjust-sub-menu-width\/","title":{"rendered":"How to change the width of mega sub menus"},"content":{"rendered":"<p>To adjust the width of the mega menu, go to <em>Mega Menu &gt; Menu Themes<\/em>.<\/p>\n<p>The width of the mega menus are defined by the &#8216;Panel Width&#8217; setting.<\/p>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/07\/theme-editor-panel-width.png?bust\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-163130\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/07\/theme-editor-panel-width.png?bust\" alt=\"\" width=\"2390\" height=\"660\" \/><\/a><\/p>\n<p>There are 3 types of value you can use for this setting:<\/p>\n<h3>Option 1. Percentage Width<\/h3>\n<p>Entering a percentage width will make the sub menus display at a width relative to the menu itself.<\/p>\n<p>For example: <strong>100% (default)<\/strong><\/p>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/07\/theme-editor-panel-width-percent.png?bust\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-163120\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/07\/theme-editor-panel-width-percent.png?bust\" alt=\"\" width=\"1430\" height=\"150\" \/><\/a><\/p>\n<p>Percentage width menus will always be aligned to the left hand edge of the menu bar. <strong>In most cases, the only percentage width you should use is\u00a0100%<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/percentage.png?bust\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-153321 size-full\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/percentage.png?bust\" alt=\"\" width=\"2616\" height=\"1560\" srcset=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/percentage.png 2616w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/percentage-300x179.png 300w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/percentage-768x458.png 768w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/percentage-1024x611.png 1024w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/percentage-50x30.png 50w\" sizes=\"auto, (max-width: 2616px) 100vw, 2616px\" \/><\/a><\/p>\n<h3>Option 2. Fixed Width<\/h3>\n<p>To fix the sub menu at a certain width, regardless of screen size, enter a pixel based value.<\/p>\n<p>For example: <strong>500px<\/strong><\/p>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/07\/theme-editor-panel-width-pixel.png?bust\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-163122\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/07\/theme-editor-panel-width-pixel.png?bust\" alt=\"\" width=\"1366\" height=\"132\" \/><\/a><\/p>\n<p><strong>Fixed width sub menus will always be aligned to the left hand edge of the parent menu item. <\/strong>You can adjust the alignment using the &#8220;Sub Menu Align&#8221; option in the <a href=\"https:\/\/www.megamenu.com\/documentation\/menu-item-options\/\">parent menu item options<\/a>.<\/p>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/pixel.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-153323 size-full\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/pixel.png\" alt=\"\" width=\"2616\" height=\"1560\" srcset=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/pixel.png 2616w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/pixel-300x179.png 300w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/pixel-768x458.png 768w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/pixel-1024x611.png 1024w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/pixel-50x30.png 50w\" sizes=\"auto, (max-width: 2616px) 100vw, 2616px\" \/><\/a><\/p>\n<h3>Option 3. Dynamic Width (jQuery\/CSS Selector)<\/h3>\n<p>Dynamic widths can be used to\u00a0automatically align and size the sub menu to match an existing element on the page.<\/p>\n<p>To make use of this feature you&#8217;ll need to find\u00a0the HTML element that wraps your page content and use\u00a0the ID or class of the element (in the form of a jQuery selector) as Panel Width setting.<\/p>\n<p>For example: #container, body, #page, .content.<\/p>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/07\/theme-editor-panel-width-selector.png?bust\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-163124\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/07\/theme-editor-panel-width-selector.png?bust\" alt=\"\" width=\"1456\" height=\"144\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/dynamic.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-153329 size-full\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/dynamic.png\" alt=\"\" width=\"2616\" height=\"1560\" srcset=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/dynamic.png 2616w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/dynamic-300x179.png 300w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/dynamic-768x458.png 768w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/dynamic-1024x611.png 1024w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/dynamic-50x30.png 50w\" sizes=\"auto, (max-width: 2616px) 100vw, 2616px\" \/><\/a><\/p>\n<p>In the example above we set the Panel Width (Outer) to &#8220;#content&#8221;. This value will change from theme to theme, so you will need to right click on the page and go to &#8220;Inspect&#8221; to find the correct class or ID to use as your Panel Width.<\/p>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/inspect-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-153335\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/inspect-1.png\" alt=\"\" width=\"2616\" height=\"1560\" srcset=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/inspect-1.png 2616w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/inspect-1-300x179.png 300w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/inspect-1-768x458.png 768w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/inspect-1-1024x611.png 1024w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/04\/inspect-1-50x30.png 50w\" sizes=\"auto, (max-width: 2616px) 100vw, 2616px\" \/><\/a><\/p>\n<h4>Stretching the menu to fill the browser width<\/h4>\n<p>In the example below we have set the Outer width to &#8220;body&#8221; (to fill the width of the page) and the Inner Width to &#8220;#content&#8221; (to line up with the existing page content).<\/p>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/07\/theme-editor-panel-width-stretch.png?bust\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-163126\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/07\/theme-editor-panel-width-stretch.png?bust\" alt=\"\" width=\"1446\" height=\"146\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/05\/panel-stretch.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-153850 size-full\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/05\/panel-stretch.png\" alt=\"\" width=\"2920\" height=\"1560\" srcset=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/05\/panel-stretch.png 2920w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/05\/panel-stretch-300x160.png 300w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/05\/panel-stretch-768x410.png 768w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/05\/panel-stretch-1024x547.png 1024w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/05\/panel-stretch-50x27.png 50w\" sizes=\"auto, (max-width: 2920px) 100vw, 2920px\" \/><\/a><\/p>\n<h3>Custom Sub Menu Widths<\/h3>\n<p>With Max Mega Menu Pro it is possible to set a sub menu width <strong>per menu item<\/strong>. This value will override the general theme setting.<\/p>\n<p>For example, you could set one sub menu to be 400px wide and another to be 700px wide.<\/p>\n<div id=\"attachment_13059\" style=\"width: 2656px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2015\/03\/custom-sub-menu-width.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13059\" class=\"size-full wp-image-13059\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2015\/03\/custom-sub-menu-width.png\" alt=\"Custom sub menu width\" width=\"2646\" height=\"1692\" srcset=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2015\/03\/custom-sub-menu-width.png 2646w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2015\/03\/custom-sub-menu-width-300x192.png 300w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2015\/03\/custom-sub-menu-width-768x491.png 768w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2015\/03\/custom-sub-menu-width-1024x655.png 1024w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2015\/03\/custom-sub-menu-width-50x32.png 50w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2015\/03\/custom-sub-menu-width-1064x680.png 1064w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2015\/03\/custom-sub-menu-width-620x396.png 620w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2015\/03\/custom-sub-menu-width-400x256.png 400w\" sizes=\"auto, (max-width: 2646px) 100vw, 2646px\" \/><\/a><p id=\"caption-attachment-13059\" class=\"wp-caption-text\">Custom Sub Menu Width<\/p><\/div>\n<p>This functionality is part of <a href=\"https:\/\/www.megamenu.com\/documentation\/pro-features\/item-styling\/\">Custom Item Styling<\/a>.<\/p>\n<h3>FAQ:<\/h3>\n<p><strong>Can the sub menu width automatically adjust to fit the content?<\/strong><\/p>\n<p>In short, no.<\/p>\n<p>All HTML elements must have a width specified at some point. An HTML element\u00a0may inherit the width from its parent (e.g. you can say &#8220;this element should be 50% of the width of its parent&#8221;), or you might directly specify a width (e.g. &#8220;this element should be 600px wide&#8221;).<\/p>\n<p>You cannot say &#8220;work out the ideal width for this element and apply it&#8221;. HTML &amp; CSS do not understand what\u00a0a human&#8217;s idea of the ideal width would be.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To adjust the width of the mega menu, go to Mega Menu &gt; Menu Themes. The width of the mega menus are defined by the &#8216;Panel Width&#8217; setting. There are 3 types of value you can use for this setting: Option 1. Percentage Width Entering a percentage width will make&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"open","ping_status":"open","template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"ht-kb-category":[14],"ht-kb-tag":[],"class_list":["post-654","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-faqs"],"uagb_featured_image_src":[],"uagb_author_info":{"display_name":"Tom Hemsley","author_link":"https:\/\/www.megamenu.com\/author\/megamenu\/"},"uagb_comment_info":0,"uagb_excerpt":"To adjust the width of the mega menu, go to Mega Menu &gt; Menu Themes. The width of the mega menus are defined by the &#8216;Panel Width&#8217; setting. There are 3 types of value you can use for this setting: Option 1. Percentage Width Entering a percentage width will make...","_links":{"self":[{"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb\/654","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/comments?post=654"}],"version-history":[{"count":20,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb\/654\/revisions"}],"predecessor-version":[{"id":214037,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb\/654\/revisions\/214037"}],"wp:attachment":[{"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/media?parent=654"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb-category?post=654"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb-tag?post=654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}