- This topic has 11 replies, 5 voices, and was last updated 2 years, 6 months ago by Leo.
-
AuthorPosts
-
October 17, 2021 at 11:23 pm #1966809Allan
I am trying to make a mobile slider and desktop slider. However If I create to different elements only one shows..
I have set up the following CSS rule
@media only screen and (min-width: 600px) {
.mobile
{display:none!important}
}
}
@media only screen and (max-width: 600px) {
.desktop
{display:none!important}
}
}In fact if I comment these out it still only one shows
October 18, 2021 at 12:02 am #1966830ElvinStaffCustomer SupportHi Allan,
Let’s fix the CSS a bit.
@media rules shouldn’t have overlapping min/max width values.Example:
@media only screen and (min-width: 601px) { .mobile {display:none!important} } } @media only screen and (max-width: 600px) { .desktop {display:none!important} } }
I just changed min-width to 601px so it doesn’t overlap with
max-width: 600px;
.If I understood it right, I believe you’re trying to make elements with selector
.desktop
hidden on screens 600px and smaller while elements with.mobile
selector gets hidden on screens 601px or larger?October 18, 2021 at 2:30 am #1966933Allanso problem is firstly. I want these both to show. but they won’t
https://christom.tinytake.com/msc/NTk1MzkyMV8xODEyNzEwNAWithin the top element is the below
https://christom.tinytake.com/msc/NTk1MzkyOF8xODEyNzExMgThe bottom one is
https://christom.tinytake.com/msc/NTk1MzkzMV8xODEyNzExNQIf I can get them both to show then I can apply the display:none css
October 18, 2021 at 4:12 am #1967014DavidStaffCustomer SupportHi there,
Only one Header Element can be used on a page.
The simplest solution would be to use one header element and wrap your slider shortcodes in their own divs eg.<div class="hide-on-mobile"> Your desktop / tablet shortcode here </div> <div class-"hide-on-desktop hide-on-tablet"> Your mobile shortcode here </div>
October 18, 2021 at 11:22 am #1967605AllanYeah that isn’t working
[slide-anything id=’1370′][slide-anything id=”2241″]I have not removed any CSS and not they should both be showing 2 sliders, but there is still only one?
October 18, 2021 at 11:50 am #1967627YingStaffCustomer SupportHi Allan,
As David says, there should only be 1 header element per page.
Can you confirm that you add both shortcode into the same header element, and the other header element has been deactivated?
If yes, can you share the exact code you are using in the active header element?
October 18, 2021 at 11:58 am #1967636AllanIt is in the same element
codes below
[slide-anything id=’1370′][slide-anything id=”2241″]October 18, 2021 at 12:03 pm #1967643LeoStaffCustomer SupportCan you try using the same quotation for the ID?
Any chance you can link us to the page in question?
October 18, 2021 at 4:03 pm #1967798AllanSorry page is hidden behind holding page.. Would have to give someone private access
October 18, 2021 at 6:20 pm #1967849LeoStaffCustomer SupportDid you try fixing the quotation as I pointed out above?
You can use the private info field here:
https://docs.generatepress.com/article/using-the-premium-support-forum/#private-informationOctober 19, 2021 at 11:10 am #1968853AllanThis is solved. It was a problem with the slider plugin. I have done a work around. Thanks for your help ๐
October 19, 2021 at 11:11 am #1968855LeoStaffCustomer SupportNo problem ๐
-
AuthorPosts
- The topic ‘Merge Element only shows one’ is closed to new replies.