Hello all.
I have designed a button called “Facial Recognition Login” inside an HTML template by using CSS code.
The CSS code is located inside the ‘static’ directory which I have loaded into the HTML template called “login.html”.
What I am trying to do is to make the button much smaller.
As visible in the following image, the button titled “Facial Recognition Login” is far too large.
The following is inside the “login.html” template:
<script src="index.js" defer></script>
<a href="{% url 'facial-login' %}"
class="facial-login-button">Facial Recognition Login</a>
The following is the css file titled “facial-login-button.css”:
body {
font-family: system-ui;
/*Set the background colour.*/
background: hs1(200 50% 5%);
min-height: 100vh;
display: grid;
/*Setting 'place-items' to 'center' will place the button in the
horizontal and vertical center of the web page.*/
place-items: center;
}
/*The name here must match the name used in the class for the
button that we are trying to style.*/
.facial-login-button
{
/*In order to center items vertically and horizontally with 'place-items'
we must set 'inline-flex' to the 'display' property.*/
display: inline-flex;
place-items: center;
position: relative;
isolation: isolate;
/*Setting 'appearance' to 'none' will suppress the native styles
so that CSS can be used to fully restyle the native form controls.*/
appearance: none;
/*Setting 'pointer' to cursor will display a mouse hand when hovering
over the button.*/
cursor: pointer;
font-size: 1rem;
padding: 1em 1em;
/*Make the button text uppercase.*/
text-transform: uppercase;
background-color: transparent;
color: hsl(200 90% 55%);
/*Set the colour for the border around the button. 'currentColor'
refers to the value set for the 'color' property above.*/
border: 5px solid currentColor;
/*Setting the '0.125em' to 'border-radius' will give the button
soft edges for each of its four corners.*/
border-radius: 0.125em;
/*Setting 'hidden' to 'overflow' will prevent the circle generated
from clicking on button, from being displayed outside the box of
the button.*/
overflow: hidden;
}
.facial-login-button::after
{
/*The 'content' property must be included because this is a
pseudo element in CSS.*/
content: "";
position: absolute;
top: var(--x);
left: var(--y);
/*We must set 'translate(-50%, -50%) to 'transform', so that
the mouse pointer is in the center of the circle. 'scale(0)'
will make the circle disappear so it is now shown in the background.*/
transform: translate(-50%, -50%) scale(0);
/*Setting 'transform 500ms' to 'transform' will expand a circle surrounding
the mouse pointer whilst the user clicks the button. When the button is
released, the circle will shrink back to the point where it is no longer visible.*/
transition: transform 500ms;
/*Setting -1 to 'z-index' will put the circlelike bubble behind the text.*/
z-index: -1;
display: block;
width: 160%;
aspect-ratio: 1 / 1;
/*Setting 50% to 'border-radius' will create a circlelike bubble that
ripples out upon clicking the button.*/
border-radius: 50%;
background: #fff;
opacity: 0.5;
}
.pulse::before {
animation: pulse 500ms;
}
@keyframes pulse
{
100% {
transform: translate(-50%, -50%) scale(1);
opacity: 0;
}
}
The problem is that even after I assigned “1rem” to “font-size”, the size of the “Facial Recognition Button” has not changed. Any ideas on how I could make the button smaller?