I have a very simple code and this particular problems occurs very often to me. I don't understand why the % doesn't change the height, only vh does. On the contrary, width doesn't have this problem and I could set it up with %.
This is the app component:
import MainPage from "./MainPage/MainPage";
import Headline from "./Headline/Headline";
import "./App.css";
function App() {
  return (
    <div className="App">
      <Headline />
      <MainPage />
    </div>
  );
}
And its CSS:
.App {
  height: 100%;
  width: 100%;
  text-align: center;
  background-color: white;
  display: flex;
  flex-direction: column;
}
This is the Headline component. Here you can see the problem:
import "./Headline.css";
function Headline() {
  return (
    <div className="headline-container">
      <div className="headline">Cryprocurrency Tracker</div>
    </div>
  );
}
And here is Headline's css:
.headline-container {
  height: 10vh;      --------> % doesn't work, I can change the height only with vh.
  width: 100%;       --------> width however doesn't have this problem at all.
  background-color: #0060ff;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: white;
  font-size: 30px;
  font-weight: 800;
  font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
}
.headline {
  height: 100%;
  width: 90%;
  display: flex;
}
EDIT: Here is the index css just in case. Index has only one child component in it and it's app:
body {
  height: 100vh;
  width: 100vw;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
    monospace;
}
 
     
    