No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How can I hide a column

    Framework
    4
    5
    2004
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      maxant last edited by

      I’m using CSS to layout rows and columns and I would like to hide a column when the browser is very thin (XS).

      <div class=”row” style="width: 100%; border: 5px solid red;">
          <div class="row">
              <div class="col-md-3 col-xs-hidden" style="border: 5px solid red;">menu</div>
              <div class="col-md-2 col-xs-12" style="border: 5px solid red;">1</div>
              <div class="col-md-2 col-xs-12" style="border: 5px solid red;">2</div>
              <div class="col-md-2 col-xs-12" style="border: 5px solid red;">3</div>
              <div class="col-md-3 col-xs-12" style="border: 5px solid red;">context</div>
          </div>
      </div>
      

      The column with content “menu” should be hidden when the screen is small. I tried “col-xs-hidden” but that doesn’t exist in the imported css file. I guess I could add my own, but if something already exists, I’d rather use that.

      1 Reply Last reply Reply Quote 0
      • metalsadman
        metalsadman last edited by metalsadman

        @maxant use $q.screen https://v1.quasar-framework.org/options/screen-plugin.
        like so:

        <div :class="`col-md-3 ${$q.screen.xs ? 'hidden': ''}`" style="border: 5px solid red;">menu</div>
        
        M 1 Reply Last reply Reply Quote 1
        • M
          maxant @metalsadman last edited by

          @metalsadman perfect, thanks!

          1 Reply Last reply Reply Quote 0
          • lucasfernog
            lucasfernog last edited by

            There is also https://v1.quasar-framework.org/style/visibility#Window-Width-Related

            Which is simplier

            D 1 Reply Last reply Reply Quote 2
            • D
              danbars @lucasfernog last edited by

              Link has changed: https://quasar.dev/style/visibility#Window-Width-Related

              basically lt- and gt- prefixes allow visibility on resolutions less than or greater than what is defined. E.g. lt-lg will be displayed on xs, sm and md

              1 Reply Last reply Reply Quote 1
              • First post
                Last post