Angular project
I have a resizable button that works under certain conditions. My problem is that I feel my code should work, and I will explain what I have and what is expected.
app.component.ts
<button class="button button5"> </button>
app.component.css
.button {
background-color: #0066ff;
border: 1px solid #0066ff;
color: white;
height: 60%;
width: 60%;
margin-left: 20%;
margin-right: auto;
margin-top: 20%;
padding: 0;
}
.button5 {
border-radius: 50%;
}
index.html
<body>
<app-root>
</app-root>
</body>
index.html css
<style>
body, html {
height: 100%;
width: 100%;
margin: 0;
}
app-root {
display: block;
height: 100%;
width: 100%;
margin: 0;
}
</style>
My goal is to create a button, that is always 60% height of the page, and 20% from the top. Also, 60% width while being 20% from the left.
This works perfectly under certain conditions such as.Here is my goal, unresized but when I resize it a little bit This happens.
As you can see it is not 20%. I do not know why, at no point did I ever hard code values
and the entire time I am strictly using percentages
so I thought it was fool proof. Why does it look like 5% on the top and 35% on the bottom