diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index 8dad26dced956..f7b626cd6b985 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -1489,6 +1489,14 @@ h4 > .notable-traits {
background-color: rgba(0,0,0,0);
height: 100%;
}
+ /*
+ This allows to prevent the version text to overflow the sidebar title on mobile mode when the
+ sidebar is displayed (after clicking on the "hamburger" button).
+ */
+ .sidebar.mobile > div.version {
+ overflow: hidden;
+ max-height: 33px;
+ }
.sidebar {
width: calc(100% + 30px);
}