How to make the sub-menu wider or reduce the text size of the sub-menus?

Solved

How to make the sub-menu wider or reduce the text size of the sub-menus?

LSAccounting
Trailblazer
205 1 31

My menu and sub-menu appears on hover.

 

As you can see in the picture below, the names of my pages are not shown in full as the menu is short.

 

Is there a way to make the sub-menu box wider so the page names show in full? OR change the text size so it appears smaller and fits in the box.

 

Untitled.png

 

www.lsaccountingfirm.com

By L&S Team
Accepted Solutions (2)

BSS-TekLabs
Shopify Partner
2401 695 831

This is an accepted solution.

- Here is the solution for you @LSAccounting 
- Please follow these steps:

step.png

- Then find the theme.css file.
- Then add the following code at the end of the file and press 'Save' to save it.

@media only screen and (min-width: 600px) {
 html:not(.no-js) .navigation__submenu[data-depth="2"] {
 width: 300px !important;
}
}

- Here is the result you will achieve:

BSSTekLabs_0-1721054377640.png

 

 

- Please press 'Like' and mark it as 'Solution' if you find it helpful. Thank you.

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.


Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)


Salemate: Boost your AVO with 2-layer offer, countdown upsell in your post purchase page


BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

View solution in original post

Made4uo-Ribe
Shopify Partner
10036 2387 3013

This is an accepted solution.

Hi @LSAccounting 

Check this one.

  1. From you Admin page, go to Online Store > Themes
  1. Select the theme you want to edit
  2. Under the Asset folder, open the main.css(base.css, style.css or theme.css)
  3. Then place the code below at the very bottom of the file.

 

header > div.header__inner > div.header__below-left > nav > ul > li:nth-child(5) > ul > li:nth-child(2) > ul {
    width: auto;
}
html:not(.no-js) .navigation__submenu[data-depth="2"] {
    margin-left: 0;
}
html:not(.no-js) .navigation__submenu {
    --width: 350px;
}

 

  • And Save. 
  • Result:
  • Made4uoRibe_0-1721066761964.png

     

Please don't forget to Like and Mark Solution to the post that helped you. Thanks!

If this fixed your issue, Likes and Accept as Solution are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.

View solution in original post

Replies 3 (3)

BSS-TekLabs
Shopify Partner
2401 695 831

This is an accepted solution.

- Here is the solution for you @LSAccounting 
- Please follow these steps:

step.png

- Then find the theme.css file.
- Then add the following code at the end of the file and press 'Save' to save it.

@media only screen and (min-width: 600px) {
 html:not(.no-js) .navigation__submenu[data-depth="2"] {
 width: 300px !important;
}
}

- Here is the result you will achieve:

BSSTekLabs_0-1721054377640.png

 

 

- Please press 'Like' and mark it as 'Solution' if you find it helpful. Thank you.

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.


Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)


Salemate: Boost your AVO with 2-layer offer, countdown upsell in your post purchase page


BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

Gideon11
Shopify Partner
46 5 5

Hi, 

1. Log into your store and go to customize.

Screenshot 2024-07-15 162048.png

2. Go to Header settings, scroll to the bottom and click custom css,

Screenshot 2024-07-15 162157.png

3.Copy and paste the following:

 

 

 

html:not(.no-js) .navigation__submenu-item {
    width: max-content;
    padding-inline: 10px !important;
}

 

 

The above code will make sure the size of the box is always larger than the content.

The above code solves the problem you postem, but your navbar has an overflow issue, because the user has to scroll to reveal the PDF Forms item. 

My PC is 15.6", and I had to scroll. To fix this problem, you can take one of the options below;

 

 

 You can opt for a vertical navbar (Check Attached Image)

Screenshot 2024-07-15 161249.png

You may opt for a mega menu with lesser main nav links.

Third option is to reduce the number of items on your main navbar, you can move the excess to the footer.

Made4uo-Ribe
Shopify Partner
10036 2387 3013

This is an accepted solution.

Hi @LSAccounting 

Check this one.

  1. From you Admin page, go to Online Store > Themes
  1. Select the theme you want to edit
  2. Under the Asset folder, open the main.css(base.css, style.css or theme.css)
  3. Then place the code below at the very bottom of the file.

 

header > div.header__inner > div.header__below-left > nav > ul > li:nth-child(5) > ul > li:nth-child(2) > ul {
    width: auto;
}
html:not(.no-js) .navigation__submenu[data-depth="2"] {
    margin-left: 0;
}
html:not(.no-js) .navigation__submenu {
    --width: 350px;
}

 

  • And Save. 
  • Result:
  • Made4uoRibe_0-1721066761964.png

     

Please don't forget to Like and Mark Solution to the post that helped you. Thanks!

If this fixed your issue, Likes and Accept as Solution are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.