- This topic has 9 replies, 3 voices, and was last updated 4 years, 5 months ago by
Tom.
-
AuthorPosts
-
December 24, 2018 at 12:15 am #764535
John
Hi,
On tablet the menu toggle is displayed when looking in portrait view. When you flip the tablet over to landscape the toggle is replaced by a sidebar with menu. (On desktop i have a vertical menu into the sidebar) I would like to have a similar behavior on tablet i.e. menu toggle both in portrait and landscape view. and maintain the sidebar menu on desktop. I tried this CSS
@media (min-width: 769px) and (max-width: 1024px) {
#left-sidebar {
display: none;
}
}That did not work out. Should i use different break points ?
Thanks,
JohnDecember 24, 2018 at 4:50 am #764623David
StaffCustomer SupportHi there,
table landscape media queries can be a bit hit and miss but you can try this one:
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) { /* STYLES GO HERE */}
December 24, 2018 at 6:54 am #764752John
Hi David;
I did not work out, below i copied all the associated CSS i have, maybe some conflict with eachother ?
@media (min-width:769px) {
.menu-item-has-children .dropdown-menu-toggle {
font-size: 26px;
}
}
@media (max-width: 768px) {
.menu-item-has-children .dropdown-menu-toggle {
font-size: 24px;
}
}
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : landscape) {
#left-sidebar {
display: none;
}
}December 24, 2018 at 7:00 am #764757David
StaffCustomer SupportThey can be tricky little rascals. Try this with the pixel ratio defined:
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape) and (-webkit-min-device-pixel-ratio: 1) { #left-sidebar { display: none; } }
December 24, 2018 at 7:07 am #764760John
Hi David,
Tricky they are, the sidebar is still there.
John
December 26, 2018 at 9:08 am #765985Tom
Lead DeveloperLead DeveloperHi there,
Is that code not hiding the sidebar at all?
December 26, 2018 at 9:34 am #766006John
No, soory.
I have installed it on my testsite, with some elementor nav widgets.
You can check it here:https://mijntestdomain.masbernadis.eu/blog/This is all the CSS added:
.site-header {
display: none;
}
h1.entry-title {
display: none;
}
.separate-containers .site-main, .entry-content {
margin-top: 0px;
}
.separate-containers .inside-article {
padding-top: 0px;
}
@media (min-width:769px) {
.menu-item-has-children .dropdown-menu-toggle {
font-size: 26px;
}
}
@media (max-width: 768px) {
.menu-item-has-children .dropdown-menu-toggle {
font-size: 24px;
}
}
@media only screen
and (min-device-width: 768px)
and (max-device-width: 1024px)
and (orientation: landscape)
and (-webkit-min-device-pixel-ratio: 1) {
#left-sidebar {
display: none!important;
}
}
._2p3a{
width:100%!important;
}December 26, 2018 at 9:37 pm #766330Tom
Lead DeveloperLead DeveloperTry this instead:
@media (max-width: 1024px) { #left-sidebar { display: none; } .content-area { float: none; width: 100%; left: 0; } }
December 26, 2018 at 11:45 pm #766370John
Yes, that works out perfectly.
Thanks Tom
December 27, 2018 at 9:16 am #766795Tom
Lead DeveloperLead DeveloperYou’re welcome 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.