I attempted to implement @media (hover: hover)
without success. In my design, I have three images in a row that reveal a text overlay when hovered over with a mouse. However, the issue arises when I try to switch to a mobile view, as the images remain unaffected. I am torn between troubleshooting @media (hover: hover)
or exploring alternative solutions. As a newcomer to website development and Stack Overflow, I find myself struggling to navigate these challenges. I have not found any existing questions that closely resemble my dilemma and guide me towards a resolution. Below is an excerpt of my CSS code.
.card-container
{
margin-top: 10%;
}
.card-container h1
{
font-family: merriweather;
}
.card
{
position: relative;
overflow: hidden;
}
.card:before
{
position: absolute;
content: '';
width: 80%;
height: 220%;
background: rgba(217, 153, 35, 0.7);
top: -50%;
left: -100%;
z-index: 1;
transform: rotate(25deg);
transform-origin: center top 0;
transition: .5s;
}
.card:hover:before
{
left: 10%;
}
.card img
{
width: 100%;
height: auto;
}
.card-text
{
width: 100%;
padding: 0 20px;
position: absolute;
top: -100%;
color: #ffff;
left: 0;
z-index: 2;
transition: 1.1s;
}
.card-text h3
{
font-family: merriweather;
font-weight: 900;
}
.card-text h5
{
font-family: lora;
}
.card:hover .card-text
{
top: 80px;
}