I am experiencing a strange issue where the breakpoints in my Tailwind CSS are behaving unexpectedly

My implementation in next.js and tailwind is supposed to use display flex by default and switch to flex-col-reverse at the md breakpoint. However, it seems to be doing the opposite. How can I resolve this issue? (The line of code in question is the second line) How to build genuine digital relationships and influence people By Dale Carnegie Timeless guidance for success in the digital era

      <div className="w-full border-b border-[#e1e7ea]">
        <div className="flex flex-wrap justify-between w-[400px] py-4  ">
          <InnerBookRating icon={<AiOutlineStar />} text={"4.4 (608 ratings)"} />
          <InnerBookRating icon={<AiOutlineClockCircle />} text={"03:24"} />
          <InnerBookRating icon={<BiMicrophone />} text={"Audio & Text"} />
          <InnerBookRating icon={<HiOutlineLightBulb />} text={"8 Key Ideas"} />
        </div>
      </div>

      <div className="space-y-6 mt-6">
        <div className="flex space-x-4">
          <button className="flex justify-center items-center text-lg space-x-2 px-8 py-2 bg-[#032b41] text-[#fff] rounded-md text-[24px] hover:opacity-80 ">
            <i>
              <BsBook />
            </i>
            <span>Read</span>
          </button>

          <button className="flex justify-center items-center text-lg space-x-2 px-8 py-2 bg-[#032b41] text-[#fff] rounded-md text-[24px] hover:opacity-80 ">
            <i>
              <BiMicrophone />
            </i>
            <span>Listen</span>
          </button>
        </div>

        <div className="text-[#0365f2]  text-lg flex items-center space-x-2 cursor-pointer">
          <BsBookmark />
          <h1>Add Title to my Library</h1>
        </div>
      </div>

      <div className="mt-8">
        <div className="flex flex-col space-y-4 mb-5">
          <h1 className="text-lg font-bold">Whats it about?</h1>
          <div className="flex space-x-4">
            <div className="p-3 rounded-md from-neutral-800 bg-[#f1f6f4]">
              Communication Skills
            </div>
            <div className="p-3 rounded-md bg-[#f1f6f4]">
              Technology & the Future
            </div>
          </div>
          <p>
            Lorem ipsum dolor sit amet consectetur adipisicing elit.
            Incidunt, consectetur adipisci quae sed et suscipit dicta,
            voluptatem hic officia itaque quasi facilis, consequatur quas
            labore aut distinctio fugiat molestiae porro ratione? Cumque
            iusto tempora eos hic, quis aut, ipsa voluptates voluptatum
            ipsam reiciendis eum molestias natus optio. Explicabo, excepturi
            nemo?
          </p>
        </div>
        <div className="flex flex-col space-y-4">
          <h1 className="text-lg font-bold">Whats it about?</h1>
          <p>
            Lorem ipsum, dolor sit amet consectetur adipisicing elit. Et
            unde deserunt fuga nesciunt ab magnam iure ipsam officia fugiat
            id reiciendis cum sapiente repudiandae hic repellat, magni quia
            ea, minima praesentium quo quae? Quibusdam, dolore? Quisquam
            delectus quam quas, eum dolorem odio omnis expedita nesciunt
            laudantium architecto. Unde, non ab?
          </p>
        </div>
      </div>
    </div>

    <div className="pl-6 flex justify-center">
      <figure className="w-[300px]">
        <img className="" src="/assets/book.png" />
      </figure>
    </div>
  </div>
</div>`

I've also attempted to reverse the code so that it defaults to flex-col-reverse and switches to display flex on the md breakpoint, but that doesn't seem to be effective either.

Answer №1

I'm not sure where exactly the mention of a breakpoint is needed, but I can give you an explanation.
In order to achieve the desired behavior, you should do it like this -

flex md:flex-col-reverse

For more information, you can refer to the tailwindCSS documentation at - https://tailwindcss.com/docs/responsive-design

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

I am looking for guidance on how to seamlessly link a Wix blog with a Next.js website. Can anyone provide me

I'm currently in the process of building a website for my friend using next.js. She already has a blog on Wix and now wants to integrate it into her new website. Should I build a new blog from scratch with next.js or attempt to connect her existing Wi ...

Bring in an asynchronous function from another file to the component

Experiencing difficulties with learning NextJs, particularly async await for fetching data from Shopify. In my file library.js, all queries are stored: const domain = process.env.API_URL const storefrontAccessToken = process.env.ACCESS_TOKEN async funct ...

A guide on changing the style of a Layout component in React

Currently, I am utilizing Next.js alongside Material-UI as the framework of choice. Within my project, there is a Layout component that encapsulates the content with Material-UI's <Container>. I desire to customize the style of the Layout compon ...

Encountering a Next.js 404 Error while Attempting to Reach a Page

Encountering a 404 error while trying to access a page in my Next.js project despite following guidance from documentation and online resources. The setup is as follows: The structure of my Next.js project is: my-nextjs-project/ app/ profile.js project ...

Exploring the integration of RTK query data within the getStaticProps() function of Next.js (encountering an error)

I recently attempted to integrate RTK query into my Next.js project, but encountered an error when trying to use the fetched data in getStaticProps(): The error message states that the React Hook "useGetEventsQuery" is being called within a function name ...

The initial state in NextJS fails to update when routing to the same page with different parameters

This particular project utilizes NextJS The structure of my page's URL is as follows: localhost:3000/first/second When I invoke getInitialProps on this page, the data retrieved from it is passed to the component and used to set the initial state li ...

Menu icon in Next.js/React/Tailwind not triggering close action when clicked again, causing responsiveness issue

Hey there, I'm relatively new to working with Next.js and React. Right now, I'm tackling the challenge of creating a responsive navbar that toggles open and closed when clicking on the hamburger icon (and should also close when clicked outside th ...

An unexpected error occurred while attempting to retrieve data from Firebase and display it in another component

An error occurred: Unhandled Runtime Error Error: Element type is invalid - expected a string (for built-in components) or a class/function (for composite components) but got undefined. This could be due to forgetting to export your component from the defi ...

What is causing me to have difficulty importing any of the images located in the public folder?

I'm currently tackling the NextJS framework, and I'm having trouble importing images that are stored in the public folder. Despite being able to navigate through folders, the images aren't displaying as expected. Here is the import line and ...

What steps should I take to resolve the 'Expected 1 arguments, but got 2.ts(2554)' error, so that I can successfully publish a post on firebase with an image URL?

The purpose of this RTkQuery endpoint is to create a post in Firestore. It requires two parameters: post and file, and utilizes the addDoc() and updateDoc() functions to carry out this operation. If a file is provided, the endpoint will upload the file to ...

Intriguing flashing dark streak, reminiscent of a boundary within NextJS

I have recently encountered an unexpected issue with my full-width video header that worked perfectly on multiple pages before. Strangely, a thin black line has appeared around the bottom and right side of the div (.header) containing the video, even thoug ...

Transferring Cookies through FETCH API using a GET method from the client-side to the server-side

Struggling with a challenge here: Attempting to send a cookie via a GET request to determine if the user is logged in. The cookie is successfully transmitted to my browser and is visible in the developer tools. When I manually make a request through the UR ...

How to import a glTF file in Next.js with the help of the 'react-3d-viewer' package

I'm attempting to load a gltf file in Next.js React using the npm package 'react-3d-viewer'. The gltf file is fetched from a database. import {GLTFModel,AmbientLight,DirectionLight} from 'react-3d-viewer' import React, { Suspen ...

Do all the data get stored in Next.js SSR caching or just the data that is returned?

Working with an API that offers pagination but lacks the ability to sort data according to client requirements, I had to come up with a workaround. My solution involves fetching all the data from the API within getServerSideProps and returning only a subse ...

The component 'ProtectRoute' cannot be utilized within JSX

While using typescript with nextjs, I encountered an issue as illustrated in the image. When I try to use a component as a JSX element, typescript displays the message: ProtectRoute' cannot be used as a JSX component. import { PropsWithChildren } from ...

What could be causing the appearance of two vertical scrollbars after transitioning from ReactJS to NextJS?

During the development of a project in plain ReactJS, I added these two lines to my index.css: overflow-y: scroll; overflow-x: hidden; The purpose was to ensure a vertical scrollbar always appeared without causing a horizontal scrollbar even when there wa ...

I have noticed that the Tailwind CSS classes are not being applied in my component until I bring it into my page.js file

I have been experiencing issues with Tailwind not working properly on my Next.js project. Despite checking all configurations, the problem persists. I discovered that by moving the code from my navbar component to my page.js, the classes would apply. How ...

What could be causing a blank page to appear after being redirected? (Using NextJS 13 API Route)

After struggling with this issue for 2 days, I'm throwing in the towel and reaching out to the community for assistance. I've been tasked with setting up a basic login system for a new project using NextJS v13. However, it seems like a lot has c ...

Troubleshooting the Hover Effect of Buttons in Next.js when Using Tailwind CSS for Dynamic Color Changes

Encountering a problem with button hover functionality in a Next.js component using Tailwind CSS. The objective is to alter the button's background color dynamically on hover based on a color value stored in the component's state. This code func ...

Attempting to conceal the API, however, the backend is throwing an error

view the error image I am currently in the process of developing an NFT search application that is capable of locating the NFTs associated with a specific wallet address. However, I am faced with the challenge of using Alchemy without exposing the API key ...