FANDOM


  • Is there a way to make a specific section with h2 heading collapsed on desktop as it is on mobile?

    [Important condition] Is it possible to do this without:

    • javascript
    • adding useless code to the mobile version (like tables) that would narrow even more the width of the section for mobile viewers.

    I mean, any class like mw-collapsible or CSS that would make some h2 sections on desktop to behave exactly as they already do on mobile screens?

    Edit: I have tried this with templates, but it broke the sections structure on mobile.

      Loading editor
    • Have you tried using

      <span class="mw-collapsible mw-collapsed wikitable"> ==whatever== sdfghgsdhjs </span> <span class="mw-collapsible mw-collapsed wikitable"> ==whatever#2== hhfjhfhf </span>

      • cleanuped my mess*

      Hmm maybe it won't work without CSS or other helpers, shrug. I tried!

      maybe a class for your headers without the wikitable ending

      mediawiki ideas: https://www.mediawiki.org/wiki/Manual:Collapsible_elements

        Loading editor
    • ==Section 1 Header==
      Section 1 Text
      ==Section 2 Header==
      <div class="mw-collapsible mw-collapsed">
      Section 2 Text
      </div>
      ==Section 3 Header==
      Section 3 Text
      ==Section 4 Header==
      <div class="mw-collapsible">
      Section 4 Text
      </div>
      ==Section 5 Header==
      Section 5 Text
      

      Section 1 Header

      Section 1 Text

      Section 2 Header

      Section 2 Text

      Section 3 Header

      Section 3 Text

      Section 4 Header

      Section 4 Text

      Section 5 Header

      Section 5 Text

        Loading editor
    • @Andrewds1021: Neat and clean, should fix his issue.

        Loading editor
    • UpnCbs06
      UpnCbs06 removed this reply because:
      unsuccessful
      03:56, February 10, 2020
      This reply has been removed
    • Thank you, Andrewds1021 and Jade Emperor. This was a simple and effective solution.

        Loading editor
    • A FANDOM user
        Loading editor
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message
Community content is available under CC-BY-SA unless otherwise noted.