switch display from flex to grid
This commit is contained in:
parent
c223c3ddab
commit
67697ef605
1 changed files with 20 additions and 13 deletions
|
@ -13,25 +13,32 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.gallery {
|
.gallery {
|
||||||
display: flex;
|
display: grid;
|
||||||
flex-wrap: wrap;
|
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||||
justify-content: space-around;
|
gap: 20px;
|
||||||
margin: 0px;
|
background: teal;
|
||||||
|
padding: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gallery-item {
|
.gallery .gallery-item {
|
||||||
flex: 0 1 calc(25% - 20px);
|
|
||||||
margin: 10px; /* Added margin between items */
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
box-sizing: border-box; /* Include padding and border in the element's total width and height */
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gallery-item img {
|
.gallery img {
|
||||||
max-width: 100%; /* Ensure images don't exceed the width of their container */
|
width: 100%;
|
||||||
height: auto;
|
|
||||||
display: block;
|
display: block;
|
||||||
|
-webkit-filter: grayscale(1);
|
||||||
|
filter: grayscale(1);
|
||||||
|
transition: all 100ms ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery .gallery-item:hover img {
|
||||||
|
transform: scale(1.04);
|
||||||
|
-webkit-filter: grayscale(0);
|
||||||
|
filter: grayscale(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.overlay {
|
.overlay {
|
||||||
|
@ -48,7 +55,7 @@
|
||||||
transition: opacity 0.3s ease;
|
transition: opacity 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gallery-item:hover .overlay {
|
.gallery .gallery-item:hover .overlay {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue