Sub menu width

Hi,
How can I make the sub menu width relative to its content? I have long page names and they are divided into two lines.

Also, how can I make the menu opens to the left in RTL pages?

Website: https://wp.sahabyah.com/ar/

Hello @aqeelat,

  1. I don’t think that there is an easy way to do that, submenu items have fixed width, you can only increase it with custom CSS code if you want. Let me know if you want to increase that width.

  2. You can try to use the following CSS code.

You can add CSS code in DashboardAppearanceCustomizeAdditional CSS (WordPress 4.7 and up). Also you can add CSS code directly to style.css file of your child theme.

#masthead #mainnav ul li ul li ul {
    left: unset;
    right: 100%;
}

However, it won’t look good on your website on medium resolutions. But you can try to rearrange your menu to move parent menu items to the right side.

Kind Regards, Roman.

This will apply to both LTR and RTL pages. I’m using polylang and have Arabic and English versions of the site. What should I do?

Hello @aqeelat,

Please try to use this CSS code instead of previous in order to apply it only on Arabic version:

html[lang="ar"] #masthead #mainnav ul li ul li ul {
    left: unset;
    right: 100%;
}

Kind Regards, Roman.