最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

css - How do I prevent the text overflow in menu?

programmeradmin1浏览0评论

The text in the navigation menu on my site is overflowing the container in the desktop version (no problem on mobile).

How do I wrap the text to prevent the overflow?

Thanks

The text in the navigation menu on my site is overflowing the container in the desktop version (no problem on mobile).

How do I wrap the text to prevent the overflow?

Thanks

Share Improve this question asked Mar 31, 2020 at 14:40 lazylordlazylord 235 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

If you use your browser's inspector f12, you can see your list items have this CSS applied...

.sf-menu li {
    white-space: nowrap;
}

You need to change it to...

.sf-menu li {
    white-space: normal;
}

If you already created a child theme you can make the change there. Otherwise, in the admin go to Appearance > Customize > Additional CSS and add the above CSS.

发布评论

评论列表(0)

  1. 暂无评论