JSFiddle - React, Tailwind, and code Playground
by maoraver
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Styling Excercise</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles/Maccabi.css">
</head>
<body>
<h1>Maccabi Haifa Football Club</h1>
<main class="container">
<figure class="picture-group">
<figcaption>Just fun</figcaption>
<img src="https://dummyimage.com/600x400/123/fff&text=Test" alt="Maccabi_Fun" class="fun">
<section class="overlay">
<section class="text"><p>Just Fun</p>
</section>
</section>
</figure>
<figure class="picture-group">
<figcaption>Love</figcaption>
<img src="https://dummyimage.com/600x400/456/fff&text=Test" alt="Maccabi_Love" class="love">
<section class="overlay">
<section class="text"><p>Love</p></section>
</section>
</figure>
<figure class="picture-group">
<figcaption>Dolev&Cherry</figcaption>
<img src="https://dummyimage.com/600x400/000/fff&text=Test" alt="Dolev&Cherry" class="doch">
<section class="overlay">
<section class="text"><p>Dolev and Cherry</p></section>
</section>
</figure>
<figure class="picture-group">
<figcaption>Celebrate</figcaption>
<img src="https://dummyimage.com/600x400/000/fff&text=Test" alt="Celebrate" class="celeb">
<section class="overlay">
<section class="text"><p>Celebrate</p></section>
</section>
</figure>
<figure class="picture-group">
<figcaption>Yoga</figcaption>
<img src="https://dummyimage.com/600x400/000/fff&text=Test" alt="Yoga" class="yoga">
<section class="overlay">
<section class="text"><p>Yoga</p></section>
</section>
</figure>
<figure...
CSS
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
:root{
font-size: 2rem;
text-transform: uppercase;
background-color: green;
}
footer{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: auto;
background-color: rgb(43, 39, 39);
opacity: 0.8;
color: ivory;
}
.container{
max-width: 800px;
margin-top: 50px;
margin-bottom: 100px;
display: flex;
flex-wrap: wrap;
margin: auto;
background-color:rgb(192, 188, 188);
}
.picture-group{
text-align: center;
flex: 1 1 50%;
position: relative;
}
h1{
text-transform: uppercase;
text-align: center;
}
@media (max-width: 600px) {
:root {
font-size: 50%;
}
}
img {
height: 300px;
width: 300px;
}
.overlay {
display: none;
position: absolute;
opacity: 0.5;
top: 0;
left: 0;
height: 100%;
width: 100%;
transition: .5s ease;
background-color: #008CBA;
}
.overlay .text{
margin-top: 200px;
}
.picture-group:hover .overlay{
display: block;
}
/* .picture-group:nth-child(1):hover .text1 {
opacity: 0.5;
} */
/* .picture-group:hover .overlay {
opacity: 0.5;
} */
/*
.text1, .text2, .text3, .text4, .text5, .text6 {
color: white;
font-size: 20px;
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
text-align: center;
} */