I wanted to change the background when I hover over the card. I had tried to add hover class but it is not working, so I am here now founding this community.
@import url("https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;700&display=swap");
*,
*::before,
*::after {
box-sizing: border-box;
padding: 0;
margin: 0;
}
:root {
--default-text-color: white;
--default-border-color: white;
--hover-background: rgba(220, 20, 60, 0.699) 0px 48px 100px 0px;
--hover-color: crimson;
}
p,
h1,
h6,
span {
font-family: "Work Sans", sans-serif;
}
html {
background-color: black;
}
.title {
text-align: center;
font-weight: 400;
font-size: 3rem;
color: white;
}
.job-role {
text-align: center;
font-weight: 500;
font-size: 2.8rem;
letter-spacing: -0.2rem;
position: relative;
bottom: 20%;
}
.job-label {
border: 1px solid transparent;
border-radius: 1.1rem;
margin: 2rem;
padding: 0.5rem;
font-weight: 500;
background-color: rgba(255, 255, 255, 0.2);
color: var(--default-text-color);
}
.job-title {
color: var(--default-text-color);
}
.job-description {
color: rgba(255, 255, 255, 0.3);
}
.location {
font-weight: 500;
font-size: 1.2rem;
font-style: bold;
color: var(--default-text-color);
margin: 1rem;
}
.card-container {
border: 1px solid var(--default-border-color);
border-radius: 1.1rem;
max-width: 350px;
height: 30rem;
margin: 1.2rem;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
position: relative;
transition: 300ms linear all;
}
.showcase {
display: flex;
justify-content: center;
}
@media screen and (max-width: 710px) {
.showcase {
flex-direction: column;
}
}
<main>
<h1 class="title">Cards</h1>
<div class="showcase">
<section class="card-container card-1" role="button" tabindex="0">
<span class="job-label">Sports, Chess</span>
<div class="job-role">
<p class="job-title">Mankuda Giri</p>
<p class="job-description">Chess Grand Master</p>
</div>
<p class="location">India</p>
</section>
</div>
</main>
I wanted to add any color in the background. Sorry for any inconvenience in the way my I posted the question. This is my first question on SO. Thanks in advance.