I am connecting an external stylesheet to my React component, and I have a media query and I intend the logo to have a height of 100vh when the screen width is less than 300px. However this media query is ignored and only the original styles apply. I tried adding the css directly in the HTML file using the style tag. Here is the relevant code:
Logo.js
import React from "react";
import "./Logo.css";
export default class Logo extends React.Component {
render() {
return (
<img
alt=""
className="Logo"
src="../logo.png"
/>
);
};
};
Logo.css
.Logo {
position: absolute;
left: 42vw;
bottom: calc(50vh + 4vw);
height: 16vw;
};
@media screen and (max-width: 300px) {
.Logo {
height: 100vh;
};
};