I'm having an issue with my webpage where the text on my CSS cards is overflowing and not staying within the card. Additionally, when I hover over an element, the remaining CSS cards are arranged in a zig-zag manner. Here's the code snippet for reference:
<!DOCTYPE html>
<html>
<head>
<title>Easy</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.self{
margin-left:160px;
}
* {
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
/* Float four columns side by side */
.column {
float: left;
width: 25%;
padding: 0 10px;
margin-bottom: 20px;
flex-basis: 25%;
}
/* Remove extra left and right margins, due to padding */
.row {margin: 0 -5px;}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
Responsive columns
@media screen and (max-width: 600px) {
.column {
width: 100%;
display: block;
margin-bottom: 20px;
}
}
/* Style the counter cards */
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 1);
padding: 16px;
text-align: center;
background-color: #f1f1f1;
transition: width 2s,height 4s;
transition-timing-function: ease-in-out;
}
.card:hover{
background-color: lightgreen;
transition-timing-function: ease-in-out;
width: 300px;
height: 300px;
}
</style>
</head>
<body style="background-color: #dae2e3;">
<div class="self">
<div class="column w3-button">
<div class="card">
<h1><?php echo"$value"; ?></h1>
<h3 style="overflow-x:page-break-inside:inherit;"><?php echo"$description";?></h3>
<h3><?php echo"$index";?></h3>
</div>
</div>
</div>
<?php }?>