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

    What is the difference between "text-center" and "flex flex-center"?

    Help
    2
    4
    279
    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.
    • W
      wpq last edited by

      When reviewing the various table styles, I noticed that the template for masonry-style grid is

        <template v-slot:item="props">
          (...)
              <q-card-section class="text-center">
               (...)
              <q-card-section class="flex flex-center" :style="{ fontSize: props.row.calories + 'px' }">
                (...)
        </template>
      

      How are these classes different (they both aim at centering one text element)? Which one should be used when?

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

        @wpq text-center like the class name suggests are for texts inside an element using text-align css, flex are for containers such as divs/elements and etc… to achieve a certain layout.

        1 Reply Last reply Reply Quote 0
        • W
          wpq last edited by

          thanks @metalsadman - I did not notice that under the former there was pure text, and under the latter a div

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

            @wpq in the docs; former https://quasar.dev/style/typography#CSS-Helper-Classes, the latter https://quasar.dev/layout/grid.

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