Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

i have a problem with flexbox and i need a solution

I put two divs next to each other, instead of them having 100vw each, the two are dividing 50% of the space for each one, is there any solution? Thanks.

Page Image

import type { AppProps } from "next/app";

import "./global.css";

function MyApp({ Component, pageProps }: AppProps) {
  return (
    <div className="flex">
      <div className="w-screen h-screen bg-red-400">mobile menu</div>
      <div className="w-screen h-screen bg-blue-400">
        <Component {...pageProps} />
      </div>
    </div>
  );
}

export default MyApp;

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Just add flex-none to childs of div with class flex.

.......
 <div className="flex">
    <div className="w-screen h-screen bg-red-400 flex-none">mobile menu</div>
    <div className="w-screen h-screen bg-blue-400 flex-none">
        <Component {...pageProps} />
    </div>
</div>
........
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading