Css media doesn't work when i re-size the screen

your textI am practicing Grid with this design. when I created @media for the design, the css doesn’t change from width full screen to phone screen. I did insert "<link rel="stylesheet" href="./css.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>" here is my html code: <div class="appdiv"> <p class="apptx">Download <br>Our App</p> <p><br>Order your favorite food from your phone!!<br> To… Read More Css media doesn't work when i re-size the screen

In CSS, is there a way to set margin-inline to auto on desktop but 1rem on mobile, without using a media query?

I am making a responsive layout. I’ve developed it mobile first, and the main container has a margin-inline: 1rem;. When the viewport grows to desktop size, I want to limit the width of the container to 500px and I want it to remained centered. Here’s a visual representation for mobile and desktop, respectively: .mobile {… Read More In CSS, is there a way to set margin-inline to auto on desktop but 1rem on mobile, without using a media query?

I'm trying to create a responsive design that adjusts to different screen sizes using CSS media queries. Can someone help me figure out what's wrong

`@media screen and (max-width: 768px) { .my-element { font-size: 16px; } } @media screen and (min-width: 768px) and (max-width: 1024px) { .my-element { font-size: 18px; } } @media screen and (min-width: 1024px) { .my-element { font-size: 20px; } }` I was expecting the font size of .my-element to adjust based on the screen size, but… Read More I'm trying to create a responsive design that adjusts to different screen sizes using CSS media queries. Can someone help me figure out what's wrong

How to use .slice with media query

I’m trying to slice objects whenever the screen is 600px and down, I’m using this code in react to know if the screen is 600px or down const [matches, setMatches] = useState( window.matchMedia("(max-width: 600px)").matches ) useEffect(() => { window .matchMedia("(max-width: 600px)") .addEventListener(‘change’, e => setMatches( e.matches )); }, []); I’m trying to show pictures return… Read More How to use .slice with media query

display hidden doesn't work with media query

Even though I have added display:none or display:hidden, the container doesn’t hide. Code: <div className="button-container"> <div className="cart-button" style={{ marginRight: "20px" }}> <p style={{ textAlign: "center" }}>Login</p> </div> <div className="cart-button"> <p style={{ textAlign: "center" }}>Cart</p> </div> </div> @media screen and (max-width: 480px) { .button-container { display: hidden; } } Codesandbox link: https://codesandbox.io/s/hardcore-platform-yzcz6m?file=/src/styles.css >Solution : Setting display… Read More display hidden doesn't work with media query