Text over Row of Images - Responsive - html

I have this example:
.gg-slides {height: auto; overflow: hidden}
.gg-con {margin: 75px 0 80px; display: flex}
.gg-icon {background: rgba(0,0,0,.6); border-radius: 99px; color: #333;
cursor: pointer; height: 126px; left: 50%; position: absolute; text-align: center; top: 50%; transition: all .5s ease; width: 126px; z-index: 3;}
<div class="gg-slides">
<div class="gg-con">
<span class="gg-slide"><img src="http://placehold.it/200x200" alt=""></span>
<span class="gg-slide"><img src="http://placehold.it/200x200" alt="">
<div class="gg-icon">
<div class="gg-count">
<span class="gg-total">10</span>
</div>
</div>
</span>
<span class="gg-slide"><img src="http://placehold.it/200x200" alt=""></span>
</div>
</div>
Essentially I'd like for the .gg-icon to appear horizontally and vertically in the middle of the 2nd image for all screen resolutions. I'm having trouble figuring this out with my current HTML structure.

You can do it with the positioning:
.gg-slides {height: auto; overflow: hidden}
.gg-con {margin: 75px 0 80px; display: flex}
.gg-icon {
background: rgba(0,0,0,.6);
border-radius: 50%;
color: #333;
cursor: pointer;
height: 126px;
/*left: 50%;*/
/*position: absolute;*/
text-align: center;
/*top: 50%;*/
transition: all .5s ease;
width: 126px;
z-index: 3;
}
/* added */
.gg-slide {
position: relative;
}
.gg-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
<div class="gg-slides">
<div class="gg-con">
<span class="gg-slide"><img src="http://placehold.it/200x200" alt="">
</span>
<span class="gg-slide"><img src="http://placehold.it/200x200" alt="">
<div class="gg-icon">
<div class="gg-count">
<span class="gg-total">10</span>
</div>
</div>
</span>
<span class="gg-slide"><img src="http://placehold.it/200x200" alt=""></span>
</div>
</div>

Another way to reach this: https://jsfiddle.net/0yjwLras/43/
I just removed the central image and put there a new div, which has the central div under it, and background-image
<div class="gg-slides">
<div class="gg-con">
<span class="gg-slide"><img src="http://avatarbox.net/avatars/img28/kitten_eyes_avatar_picture_75535.jpg" /></span>
<span class="gg-slide"><div class="BUBU"><div class="gg-icon CENTRAL-BUBU"><div class="gg-count"><span class="gg-total">10</span></div></div></div></span>
<span class="gg-slide"><img src="http://avatarbox.net/avatars/img28/kitten_eyes_avatar_picture_75535.jpg" /></span>
</div>
</div>
CSS
.gg-slides {height: auto;overflow: hidden;}
.gg-con {margin:75px 0 80px;display:flex;}
.gg-icon {background-color: rgba(255,0,0,.6);border-radius: 50%;color: #333; cursor: pointer; width: 50px; height: 50px;text-align: center;transition: all .5s ease;z-index: 3;}
.BUBU {width: 100px; height: 100px; background-image: url('http://avatarbox.net/avatars/img28/kitten_eyes_avatar_picture_75535.jpg'); background-repeat: no-repeat; padding-top: 25px;}
.CENTRAL-BUBU {margin-left: auto; margin-right: auto;}

Related

CSS Selector Reference does not work even another selector is working well?

I am trying to code a very simple HTML CSS file and here is my problem.
Here is my code
[https:// codepen.io/anhbui2904/pen/jOxeQgw][1]
My problem is, as you can see in this picture
Because of this code
.service-section .service-item{
flex: 0 0 33.33%;
max-width: 33.33%;
padding: 15px;
}
The pictures become 3 pictures per 1 line. As you can see in this picture
But I use this code
.work-section .work-item {
flex: 0 0 33.33%;
max-width: 33.33%;
padding: 15px;
}
As you can see, seems this code does not work ? The photos are still in line ? I do not know why ? Could you please give me some advice for this problem ? Thank you very much for your time.
#import url('https://fonts.googleapis.com/css?family=Raleway:300,400,700&display=swap');
body{
margin: 0;
line-height: 1.5;
background-color: #f3f2f1;
}
body,
input,textarea,
button{
font-family: 'Raleway', 'sans-serif';
font-weight: 400;
}
*{
box-sizing: border-box;
margin: 0;
}
.container{
max-width: 1170px;
margin: auto;
}
.row{
display: flex;
flex-wrap: wrap;
}
.align-items-center{
align-items: center;
}
.justify-content-between{
justify-content: space-between;
}
#keyframes ani01{
0%{
transform: rotate(0deg);
}
100%{
transform: rotate(360deg);
}
}
.section-title{
flex: 0 0 100%;
max-width: 100%;
margin-bottom: 60px;
padding: 0 15px;
}
.section-title h1{
display: inline-block;
font-size: 40px;
color: #000000;
font-weight: 700;
margin: 0;
position: relative;
}
.section-title h1:before{
content: '';
box-sizing: border-box;
position: absolute;
left: 0;
bottom: -5px;
width: 80px;
height: 3px;
background-color: #ff9800;
}
.btn-01{
background-color: #ff9800;
color: #fff;
border: 2px solid transparent;
padding: 10px 35px;
border-radius: 30px;
line-height: 1.5;
cursor: pointer;
text-decoration: none;
font-size: 16px;
font-weight: 600;
display: inline-block;
transition: all 0.5s ease;
}
.btn-01:hover{
background-color: transparent;
border-color: #FF9800;
color:#ff9800;
}
.btn-01:focus{
outline: none;
}
/* preloader */
/*.preloader{
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color: #111111;
z-index: 1099;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.6 ease;
}*/
.preloader.loaded{
visibility: hidden;
opacity: 0;
z-index: -99;
}
.preloader.loader{
height: 30px;
width: 30px;
border: 2px solid #FF9800;
border-right: 2px solid transparent;
border-radius: 50%;
animation: ani01 2s linear infinite;
}
/*Header*/
.header{
position: absolute;
left: 0;
top:0;
width: 99;
transition: all 0.5s ease;
}
.header .fixed{
background-color: #fff;
position: fixed;
}
.header .brand-name{
padding: 0 15px;
}
.header.brand-name a{
text-decoration: none;
font-size: 30px;
color: #fff;
text-transform: uppercase;
font-weight: 900;
letter-spacing: 2px;
transition: all 0.5s ease;
}
.header .fixed .brand-name a{
color: #0000;
}
.header .nav-toggle{
width: 40px;
height: 34px;
border: 1px solid #fff;
border-radius: 3px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.5s ease;
display: none;
}
.header .fixed .nav-toggle {
border-color: #000;
}
.header .nav-toggle span{
height: 1px;
display: block;
width: 16px;
background-color: #fff;
position: relative;
transition: all 0.5s ease;
}
.header .nav-toggle span::before,
.header .nav-toggle span::after{
content: '';
position: absolute;
left: 0;
top: 0;
height: 1px;
width: 100%;
background-color: #fff;
transition: all 0.5s ease;
}
.header .fixed .nav-toggle span,
.header .fixed .nav-toggle:before,
.header .fixed .nav-toggle::after{
background-color: #000000;
}
.header .nav-toggle span:before{
transform: translate(-6px);
}
.header .nav-toggle span:after{
transform: translate(6px);
}
.header .nav{
padding: 0 15px;
}
.header.nav ul{
list-style:none;
margin:0;
padding:0;
}
.header .nav ul li{
display: inline-block;
margin-left: 30px;
}
.header .nav ul li a {
text-decoration: none;
font-size: 16px;
font-weight: 600;
color: #ffffff;
padding: 25px 0;
display: block;
transition: all 0.5s ease;
}
.header .fixed .nav ul li a{
color: #000000;
}
.header .fixed .nav ul li a:hover,
.header .nav ul li a:hover{
color: #FF9800;
}
/* Home Section */
.home-section{
min-height: 100vh;
background-image: url('./img/moviebg.jpg');
background-size: cover;
background-position: center;
position: relative;
z-index: 1;
padding: 0 15px;
}
.home-section:before{
content: '';
position: absolute;
box-sizing: border-box;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color: #000000;
opacity: 0.7;
z-index: -1;
}
.home-section .shape-01{
position:absolute;
height: 30px;
width:30px;
border: 2px solid #FF9800;
right: 5%;
top: 20%;
animation: ani01 5s linear infinite;
}
.home-section .row{
min-height: 100vh;
}
.home-section .home-content{
flex: 0 0 100%;
max-width: 100%;
text-align: center;
}
.home-section.home-content h4{
font-size: 20px;
color: #ffffff;
margin: 0;
}
.home-section .home-content h2{
font-size: 60px;
margin: 0;
color: #ffffff;
text-transform: uppercase;
font-weight: 900;
letter-spacing: 10px;
}
.home-section .scroll-down{
position: absolute;
left: 50%;
bottom: 30px;
height: 30px;
width: 30px;
margin-left: -15px;
animation: scrollDown 2s ease infinite;
}
#keyframes scrollDown{
0%,20%,50%,80%,100%{
transform: translateY(0);
}
40%{
transform: translateY(-30px);
}
60%{
transform: translateY(-15px);
}
}
.home-section .scroll-down img{
width: 25px;
display: block;
margin: 2px auto;
}
.about-section {
padding: 80px 0 0;
}
.about-section .about-img{
flex: 0 0 33.33%;
max-width: 33.33%;
padding: 0 15px;
}
.about-section .about-img .img-box{
position: relative;
}
.about-section .about-img .img-box .shape-02{
position: absolute;
height: 30px;
width: 30px;
border: 2px solid #FF9800;
left: 30px;
top: 30px;
animation: ani01 5s linear infinite;
}
.about-section .about-img .img-box img{
width: 100%;
display: block;
}
.about-section .about-content{
flex: 0 0 66.66%;
max-width: 66.66%;
padding: 0 15px;
}
.about-section .section-title{
margin-bottom: 30px;
padding: 0;
}
.about-section .about-content p{
font-size: 16px;
color: #555555;
line-height: 26px;
margin: 0;
}
.about-section .about-content .stats .stat-box{
flex: 0 0 25%;
max-width: 25%;
padding: 0 15px;
text-align: center;
margin-top: 30px;
}
.about-section.about-content.stats.stat-box h2{
font-size: 40px;
color: #000000;
margin: 0 0 5px;
}
.about-section .about-content .stats .stat-box h5{
font-size: 16px;
color: #555555;
font-weight: 600;
text-transform: uppercase;
}
.about-section .about-content .btn{
margin-top: 30px;
}
/*Categories*/
.service-section {
padding: 80px 0;
}
.service-section .service-item{
flex: 0 0 33.33%;
max-width: 33.33%;
padding: 15px;
}
.service-section .service-item-inner{
position: relative;
overflow: hidden;
}
.service-section .service-item-inner {
position: relative;
overflow: hidden;
}
.service-section .service-item-inner img{
width: 100%;
display: block;
filter:grayscale(100%);
transition: all 0.5s ease;
}
.service-section .service-item-inner:hover img{
filter:grayscale(0);
transform: scale(1.1);
}
.service-section .service-item-inner .overlay{
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 100%;
background-color: rgba(0,0,0,0.6);
display: flex;
align-items: center;
justify-content: center;
transition: all 0.5s ease;
}
.service-section .service-item-inner:hover .overlay{
background-color: transparent;
}
.service-section .service-item-inner .overlay h3{
color: #ffffff;
font-size: 30px;
margin: 0;
text-align: center;
transition: all 0.5s ease;
text-transform: capitalize;
}
.service-section .service-item-inner .overlay:hover h4{
transform: translateX(30px);
opacity: 0;
}
/* Top-Rated*/
.work-section{
padding: 80px 0 0;
}
.work-section .work-item {
flex: 0 0 33.33%;
max-width: 33.33%;
padding: 15px;
}
.work-section .work-item-inner img{
width: 100%;
display: block;
transform: scale(1.1);
}
.work-section .work-item-inner:hover img{
filter: grayscale(100);
transform: scale(1);
}
.work-section .work-item-inner{
position: relative;
cursor: pointer;
overflow: hidden;
}
.work-section .work-item-inner .overlay{
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
padding: 15px;
display: flex;
align-items: flex-end;
transition: all 0.5s ease;
background-color: rgba(0,0,0,0.6);
opacity: 0;
}
.work-section .work-item-inner:hover .overlay{
opacity: 1;
}
.work-section .work-item-inner:hover .overlay h4{
color: #ffffff;
font-size: 20px;
margin: 0;
transform: translateX(30px);
transition: all 0.5s ease;;
}
.work-section .work-item-inner:hover .overlay h4{
transform: translateX(0);
}
<body>
<!--preloader-->
<div class="preloader">
<div class="loader"></div>
</div>
<!--preloader ends-->
<!--Head section starts-->
<header class="header">
<div class="container">
<div class="row justify-content-between align-items-center">
<div class="brand-name">
Movie Mania
</div>
<div class="nav-toggle">
<span></span>
</div>
<nav class="nav">
<ul>
<li>Home</li>
<li>About</li>
<li>Categories</li>
<li>Top-Rated</li>
<li>Contact</li>
</ul>
</nav>
</div>
</div>
</header>
<!-- Header end -->
<!-- Home Section starts -->
<section class="home-section" id="home">
<div class="shape-01">
</div>
<div class="container">
<div class="row align-items-center">
<div class="home-content">
<h4>Download your favourite movie in just a click</h4>
<h2>Welcome to Movie Mania</h2>
</div>
</div>
<!--Scroll Down-->
<a href="#about" class="scroll-down">
<img src="https://i.postimg.cc/vHVsxYMk/arrow-down.png" alt="scroll down">
</a>
</div>
</section>
<!-- Home section end -->
<!-- About section start -->
<section class="about-section" id="about">
<div class="container">
<div class="row">
<div class="about-img">
<div class="img-box">
<div class="shape-02"></div>
<img src="https://i.postimg.cc/76tk0b58/about.jpg" width = "30" height = "auto" alt="About US">
</div>
</div>
<div class="about-content">
<div class="row">
<div class="section-title">
<h1>About Us</h1>
</div>
</div>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </p>
<div class="stats">
<div class="row">
<div class="stat-box">
<h2>150K+</h2>
<h5>Daily Downloads</h5>
</div>
<div class="stat-box">
<h2>2500+</h2>
<h5>Movies Available</h5>
</div>
<div class="stat-box">
<h2>1M+</h2>
<h5>Happy Clients</h5>
</div>
</div>
</div>
<!--Contact Button-->
Contact Us
</div>
</div>
</div>
</section>
<!--About us ends -->
<!--Categories section start-->
<section class="service-section" id="categories">
<div class="container">
<div class="row">
<div class="section-title">
<h1>Categories</h1>
</div>
</div>
<div class="row">
<!--categories start-->
<div class="service-item">
<div class="service-item-inner">
<img src="https://i.postimg.cc/YShKkMXd/1.jpg" alt="category 1" width = "300" height = "auto">
<div class="overlay">
<h3>Ha Noi</h3>
</div>
</div>
</div>
<div class="service-item">
<div class="service-item-inner">
<img src="https://i.postimg.cc/1z2x322s/2.jpg" alt="category 2" width = "300" height = "auto">
<div class="overlay">
<h3>Hai Phong</h3>
</div>
</div>
</div>
<div class="service-item">
<div class="service-item-inner">
<img src="https://i.postimg.cc/BQBGBhLB/3.jpg" alt="category 3" width = "300" height = "auto">
<div class="overlay">
<h3>Nam Dinh</h3>
</div>
</div>
</div>
<div class="service-item">
<div class="service-item-inner">
<img src="https://i.postimg.cc/XY2STpgZ/4.jpg" alt="category 4" width = "300" height = "auto">
<div class="overlay">
<h3>Thanh Hoa</h3>
</div>
</div>
</div>
<div class="service-item">
<div class="service-item-inner">
<img src="https://i.postimg.cc/28DDvp65/5.jpg" alt="category 5" width = "300" height = "auto">
<div class="overlay">
<h3>Vinh</h3>
</div>
</div>
</div>
<div class="service-item">
<div class="service-item-inner">
<img src="https://i.postimg.cc/jSqYgzy0/6.jpg" alt="category 6" width = "300" height = "auto">
<div class="overlay">
<h3>Hue</h3>
</div>
</div>
</div>
</div>
</div>
</section>
<!--Category section ends-->
<!--Top rated section start-->
<section class="work-section" id="top">
<div class="container">
<div class="row">
<div class="section-title">
<h1>Top-Rated Movies</h1>
</div>
</div>
<div class="row">
<div class="work-item">
<div class="work-item-inner">
<img src="https://i.postimg.cc/854hHgGV/1.jpg" width = "300" height = "auto" data-large="./img/works/large/1.png" alt="Movie 1">
<div class="overlay">
<h4>Paris</h4>
</div>
</div>
</div>
</div>
<div class="row">
<div class="work-item">
<div class="work-item-inner">
<img src="https://i.postimg.cc/jjz6DJk2/2.jpg" width = "300" height = "auto" data-large="./img/works/large/2.png" alt="Movie 1">
<div class="overlay">
<h4>Berlin</h4>
</div>
</div>
</div>
</div>
<div class="row">
<div class="work-item">
<div class="work-item-inner">
<img src="https://i.postimg.cc/sXsY7Dtc/3.jpg" width = "300" height = "auto" data-large="./img/works/large/3.jpg" alt="Movie 1">
<div class="overlay">
<h4>Vill</h4>
</div>
</div>
</div>
</div>
<div class="row">
<div class="work-item">
<div class="work-item-inner">
<img src="https://i.postimg.cc/PqGzfMy0/4.jpg" width = "300" height = "auto" data-large="./img/works/large/4.jpg" alt="Movie 1">
<div class="overlay">
<h4>Thuong Hai</h4>
</div>
</div>
</div>
</div>
<div class="row">
<div class="work-item">
<div class="work-item-inner">
<img src="https://i.postimg.cc/65mfgKvW/5.jpg" width = "300" height = "auto" data-large="./img/works/large/5.jpg" alt="Movie 1">
<div class="overlay">
<h4>Bac Kinh</h4>
</div>
</div>
</div>
</div>
<div class="row">
<div class="work-item">
<div class="work-item-inner">
<img src="https://i.postimg.cc/jSn4r1Hz/6.jpg" width = "300" height = "auto" data-large="./img/works/large/6.png" alt="Movie 1">
<div class="overlay">
<h4>Trung Khanh</h4>
</div>
</div>
</div>
</div>
</div>
</section>
<!--top rated end -->
<!--contact section start-->
<section class="contact-section" id="contact">
<div class="container">
<div class="row">
<div class="img-box">
<div class="section-title">
<h1>Contact Us</h1>
</div>
</div>
</div>
</div>
<div class="row">
<div class="contact-form">
<form class="form">
<div class="row">
<div class="left input-group">
<label>Name</label>
<input type="text" placeholder="Your Name Here" class="input-control">
</div>
<div class="right input-group">
<label>Email or Phone</label>
<input type="text" placeholder="Your Email or Phone Here" class="input-control">
</div>
</div>
<div class="row">
<div class="left input-group">
<label>Message</label>
<textarea class="input-control" placeholder="Your Message Here"></textarea>
</div>
</div>
<div class="form-btn">
<button type="button" class="btn btn-01" id="button">Send Message</button>
</div>
<div id="dialog">
I know you know this, but you are awesome. As we say au revoir to another #ResearchPride month,
</div>
</form>
</div>
</div>
<div class="row">
<div class="contact-info">
<div class="row">
<div class="info-item">
<h5>Address</h5>
<p>X5 T7 U8 USA</p>
</div>
<div class="info-item">
<h5>Phone</h5>
<p>090 8403 1789</p>
</div>
<div class="info-item">
<h5>Email</h5>
<p>maviemanie#mivie.com</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="social-links">
<img src="https://i.postimg.cc/6Q9JPCRx/facebook.png" width = "100" height = "auto" alt="facebook">
<img src="https://i.postimg.cc/zBvmz50d/twitter.png" width = "100" height = "auto" alt="twitter">
<img src="https://i.postimg.cc/7Pc4LGvS/linkedin.png" width = "100" height = "auto" alt="linkedin">
<img src="https://i.postimg.cc/rsdLJc4d/intagram.jpg" width = "200" height = "auto" alt="intagram">
</div>
</div>
</section>
<p class="copyright">© 2022 Movie Mania</p>
<!--light box start-->
<div class="lightbox">
<div class="img-box">
<div class="lightbox-close">×</div>
<img src="https://i.postimg.cc/qML93zSm/2.png" width = "100" height = "auto" class="lightbox-img" alt="img1">
<div class="lightbox-caption">
<div class="lightbox-category">
</div>
<div class="lightbox-counter">
</div>
</div>
<div class="lightbox-controls">
<div class="prev">
<img src="https://i.postimg.cc/W4XLct6F/previous.png" width = "100" height = "auto" alt="previous">
</div>
<div class="next">
<img src="https://i.postimg.cc/QdZrp2dt/next.png" width = "100" height = "auto" alt="next">
</div>
</div>
</div>
</div>
<!--light box end -->
</body>
#import url('https://fonts.googleapis.com/css?family=Raleway:300,400,700&display=swap');
body{
margin: 0;
line-height: 1.5;
background-color: #f3f2f1;
}
body,
input,textarea,
button{
font-family: 'Raleway', 'sans-serif';
font-weight: 400;
}
*{
box-sizing: border-box;
margin: 0;
}
.container{
max-width: 1170px;
margin: auto;
}
.row{
display: flex;
flex-wrap: wrap;
}
.align-items-center{
align-items: center;
}
.justify-content-between{
justify-content: space-between;
}
#keyframes ani01{
0%{
transform: rotate(0deg);
}
100%{
transform: rotate(360deg);
}
}
.section-title{
flex: 0 0 100%;
max-width: 100%;
margin-bottom: 60px;
padding: 0 15px;
}
.section-title h1{
display: inline-block;
font-size: 40px;
color: #000000;
font-weight: 700;
margin: 0;
position: relative;
}
.section-title h1:before{
content: '';
box-sizing: border-box;
position: absolute;
left: 0;
bottom: -5px;
width: 80px;
height: 3px;
background-color: #ff9800;
}
.btn-01{
background-color: #ff9800;
color: #fff;
border: 2px solid transparent;
padding: 10px 35px;
border-radius: 30px;
line-height: 1.5;
cursor: pointer;
text-decoration: none;
font-size: 16px;
font-weight: 600;
display: inline-block;
transition: all 0.5s ease;
}
.btn-01:hover{
background-color: transparent;
border-color: #FF9800;
color:#ff9800;
}
.btn-01:focus{
outline: none;
}
/* preloader */
/*.preloader{
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color: #111111;
z-index: 1099;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.6 ease;
}*/
.preloader.loaded{
visibility: hidden;
opacity: 0;
z-index: -99;
}
.preloader.loader{
height: 30px;
width: 30px;
border: 2px solid #FF9800;
border-right: 2px solid transparent;
border-radius: 50%;
animation: ani01 2s linear infinite;
}
/*Header*/
.header{
position: absolute;
left: 0;
top:0;
width: 99;
transition: all 0.5s ease;
}
.header .fixed{
background-color: #fff;
position: fixed;
}
.header .brand-name{
padding: 0 15px;
}
.header.brand-name a{
text-decoration: none;
font-size: 30px;
color: #fff;
text-transform: uppercase;
font-weight: 900;
letter-spacing: 2px;
transition: all 0.5s ease;
}
.header .fixed .brand-name a{
color: #0000;
}
.header .nav-toggle{
width: 40px;
height: 34px;
border: 1px solid #fff;
border-radius: 3px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.5s ease;
display: none;
}
.header .fixed .nav-toggle {
border-color: #000;
}
.header .nav-toggle span{
height: 1px;
display: block;
width: 16px;
background-color: #fff;
position: relative;
transition: all 0.5s ease;
}
.header .nav-toggle span::before,
.header .nav-toggle span::after{
content: '';
position: absolute;
left: 0;
top: 0;
height: 1px;
width: 100%;
background-color: #fff;
transition: all 0.5s ease;
}
.header .fixed .nav-toggle span,
.header .fixed .nav-toggle:before,
.header .fixed .nav-toggle::after{
background-color: #000000;
}
.header .nav-toggle span:before{
transform: translate(-6px);
}
.header .nav-toggle span:after{
transform: translate(6px);
}
.header .nav{
padding: 0 15px;
}
.header.nav ul{
list-style:none;
margin:0;
padding:0;
}
.header .nav ul li{
display: inline-block;
margin-left: 30px;
}
.header .nav ul li a {
text-decoration: none;
font-size: 16px;
font-weight: 600;
color: #ffffff;
padding: 25px 0;
display: block;
transition: all 0.5s ease;
}
.header .fixed .nav ul li a{
color: #000000;
}
.header .fixed .nav ul li a:hover,
.header .nav ul li a:hover{
color: #FF9800;
}
/* Home Section */
.home-section{
min-height: 100vh;
background-image: url('./img/moviebg.jpg');
background-size: cover;
background-position: center;
position: relative;
z-index: 1;
padding: 0 15px;
}
.home-section:before{
content: '';
position: absolute;
box-sizing: border-box;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color: #000000;
opacity: 0.7;
z-index: -1;
}
.home-section .shape-01{
position:absolute;
height: 30px;
width:30px;
border: 2px solid #FF9800;
right: 5%;
top: 20%;
animation: ani01 5s linear infinite;
}
.home-section .row{
min-height: 100vh;
}
.home-section .home-content{
flex: 0 0 100%;
max-width: 100%;
text-align: center;
}
.home-section.home-content h4{
font-size: 20px;
color: #ffffff;
margin: 0;
}
.home-section .home-content h2{
font-size: 60px;
margin: 0;
color: #ffffff;
text-transform: uppercase;
font-weight: 900;
letter-spacing: 10px;
}
.home-section .scroll-down{
position: absolute;
left: 50%;
bottom: 30px;
height: 30px;
width: 30px;
margin-left: -15px;
animation: scrollDown 2s ease infinite;
}
#keyframes scrollDown{
0%,20%,50%,80%,100%{
transform: translateY(0);
}
40%{
transform: translateY(-30px);
}
60%{
transform: translateY(-15px);
}
}
.home-section .scroll-down img{
width: 25px;
display: block;
margin: 2px auto;
}
.about-section {
padding: 80px 0 0;
}
.about-section .about-img{
flex: 0 0 33.33%;
max-width: 33.33%;
padding: 0 15px;
}
.about-section .about-img .img-box{
position: relative;
}
.about-section .about-img .img-box .shape-02{
position: absolute;
height: 30px;
width: 30px;
border: 2px solid #FF9800;
left: 30px;
top: 30px;
animation: ani01 5s linear infinite;
}
.about-section .about-img .img-box img{
width: 100%;
display: block;
}
.about-section .about-content{
flex: 0 0 66.66%;
max-width: 66.66%;
padding: 0 15px;
}
.about-section .section-title{
margin-bottom: 30px;
padding: 0;
}
.about-section .about-content p{
font-size: 16px;
color: #555555;
line-height: 26px;
margin: 0;
}
.about-section .about-content .stats .stat-box{
flex: 0 0 25%;
max-width: 25%;
padding: 0 15px;
text-align: center;
margin-top: 30px;
}
.about-section.about-content.stats.stat-box h2{
font-size: 40px;
color: #000000;
margin: 0 0 5px;
}
.about-section .about-content .stats .stat-box h5{
font-size: 16px;
color: #555555;
font-weight: 600;
text-transform: uppercase;
}
.about-section .about-content .btn{
margin-top: 30px;
}
/*Categories*/
.service-section {
padding: 80px 0;
}
.service-section .service-item{
flex: 0 0 33.33%;
max-width: 33.33%;
padding: 15px;
}
.service-section .service-item-inner{
position: relative;
overflow: hidden;
}
.service-section .service-item-inner {
position: relative;
overflow: hidden;
}
.service-section .service-item-inner img{
width: 100%;
display: block;
filter:grayscale(100%);
transition: all 0.5s ease;
}
.service-section .service-item-inner:hover img{
filter:grayscale(0);
transform: scale(1.1);
}
.service-section .service-item-inner .overlay{
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 100%;
background-color: rgba(0,0,0,0.6);
display: flex;
align-items: center;
justify-content: center;
transition: all 0.5s ease;
}
.service-section .service-item-inner:hover .overlay{
background-color: transparent;
}
.service-section .service-item-inner .overlay h3{
color: #ffffff;
font-size: 30px;
margin: 0;
text-align: center;
transition: all 0.5s ease;
text-transform: capitalize;
}
.service-section .service-item-inner .overlay:hover h4{
transform: translateX(30px);
opacity: 0;
}
/* Top-Rated*/
.work-section{
padding: 80px 0 0;
}
.work-section .work-item {
flex: 0 0 33.33%;
max-width: 33.33%;
padding: 15px;
}
.work-section .work-item-inner img{
width: 100%;
display: block;
transform: scale(1.1);
}
.work-section .work-item-inner:hover img{
filter: grayscale(100);
transform: scale(1);
}
.work-section .work-item-inner{
position: relative;
cursor: pointer;
overflow: hidden;
}
.work-section .work-item-inner .overlay{
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
padding: 15px;
display: flex;
align-items: flex-end;
transition: all 0.5s ease;
background-color: rgba(0,0,0,0.6);
opacity: 0;
}
.work-section .work-item-inner:hover .overlay{
opacity: 1;
}
.work-section .work-item-inner:hover .overlay h4{
color: #ffffff;
font-size: 20px;
margin: 0;
transform: translateX(30px);
transition: all 0.5s ease;;
}
.work-section .work-item-inner:hover .overlay h4{
transform: translateX(0);
}
<body>
<!--preloader-->
<div class="preloader">
<div class="loader"></div>
</div>
<!--preloader ends-->
<!--Head section starts-->
<header class="header">
<div class="container">
<div class="row justify-content-between align-items-center">
<div class="brand-name">
Movie Mania
</div>
<div class="nav-toggle">
<span></span>
</div>
<nav class="nav">
<ul>
<li>Home</li>
<li>About</li>
<li>Categories</li>
<li>Top-Rated</li>
<li>Contact</li>
</ul>
</nav>
</div>
</div>
</header>
<!-- Header end -->
<!-- Home Section starts -->
<section class="home-section" id="home">
<div class="shape-01">
</div>
<div class="container">
<div class="row align-items-center">
<div class="home-content">
<h4>Download your favourite movie in just a click</h4>
<h2>Welcome to Movie Mania</h2>
</div>
</div>
<!--Scroll Down-->
<a href="#about" class="scroll-down">
<img src="https://i.postimg.cc/vHVsxYMk/arrow-down.png" alt="scroll down">
</a>
</div>
</section>
<!-- Home section end -->
<!-- About section start -->
<section class="about-section" id="about">
<div class="container">
<div class="row">
<div class="about-img">
<div class="img-box">
<div class="shape-02"></div>
<img src="https://i.postimg.cc/76tk0b58/about.jpg" width = "30" height = "auto" alt="About US">
</div>
</div>
<div class="about-content">
<div class="row">
<div class="section-title">
<h1>About Us</h1>
</div>
</div>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </p>
<div class="stats">
<div class="row">
<div class="stat-box">
<h2>150K+</h2>
<h5>Daily Downloads</h5>
</div>
<div class="stat-box">
<h2>2500+</h2>
<h5>Movies Available</h5>
</div>
<div class="stat-box">
<h2>1M+</h2>
<h5>Happy Clients</h5>
</div>
</div>
</div>
<!--Contact Button-->
Contact Us
</div>
</div>
</div>
</section>
<!--About us ends -->
<!--Categories section start-->
<section class="service-section" id="categories">
<div class="container">
<div class="row">
<div class="section-title">
<h1>Categories</h1>
</div>
</div>
<div class="row">
<!--categories start-->
<div class="service-item">
<div class="service-item-inner">
<img src="https://i.postimg.cc/YShKkMXd/1.jpg" alt="category 1" width = "300" height = "auto">
<div class="overlay">
<h3>Ha Noi</h3>
</div>
</div>
</div>
<div class="service-item">
<div class="service-item-inner">
<img src="https://i.postimg.cc/1z2x322s/2.jpg" alt="category 2" width = "300" height = "auto">
<div class="overlay">
<h3>Hai Phong</h3>
</div>
</div>
</div>
<div class="service-item">
<div class="service-item-inner">
<img src="https://i.postimg.cc/BQBGBhLB/3.jpg" alt="category 3" width = "300" height = "auto">
<div class="overlay">
<h3>Nam Dinh</h3>
</div>
</div>
</div>
<div class="service-item">
<div class="service-item-inner">
<img src="https://i.postimg.cc/XY2STpgZ/4.jpg" alt="category 4" width = "300" height = "auto">
<div class="overlay">
<h3>Thanh Hoa</h3>
</div>
</div>
</div>
<div class="service-item">
<div class="service-item-inner">
<img src="https://i.postimg.cc/28DDvp65/5.jpg" alt="category 5" width = "300" height = "auto">
<div class="overlay">
<h3>Vinh</h3>
</div>
</div>
</div>
<div class="service-item">
<div class="service-item-inner">
<img src="https://i.postimg.cc/jSqYgzy0/6.jpg" alt="category 6" width = "300" height = "auto">
<div class="overlay">
<h3>Hue</h3>
</div>
</div>
</div>
</div>
</div>
</section>
<!--Category section ends-->
<!--Top rated section start-->
<section class="work-section" id="top">
<div class="container">
<div class="row">
<div class="section-title">
<h1>Top-Rated Movies</h1>
</div>
</div>
<div class="row">
<div class="work-item">
<div class="work-item-inner">
<img src="https://i.postimg.cc/854hHgGV/1.jpg" width = "300" height = "auto" data-large="./img/works/large/1.png" alt="Movie 1">
<div class="overlay">
<h4>Paris</h4>
</div>
</div>
</div>
<div class="work-item">
<div class="work-item-inner">
<img src="https://i.postimg.cc/jjz6DJk2/2.jpg" width = "300" height = "auto" data-large="./img/works/large/2.png" alt="Movie 1">
<div class="overlay">
<h4>Berlin</h4>
</div>
</div>
</div>
<div class="work-item">
<div class="work-item-inner">
<img src="https://i.postimg.cc/sXsY7Dtc/3.jpg" width = "300" height = "auto" data-large="./img/works/large/3.jpg" alt="Movie 1">
<div class="overlay">
<h4>Vill</h4>
</div>
</div>
</div>
<div class="work-item">
<div class="work-item-inner">
<img src="https://i.postimg.cc/PqGzfMy0/4.jpg" width = "300" height = "auto" data-large="./img/works/large/4.jpg" alt="Movie 1">
<div class="overlay">
<h4>Thuong Hai</h4>
</div>
</div>
</div>
<div class="work-item">
<div class="work-item-inner">
<img src="https://i.postimg.cc/65mfgKvW/5.jpg" width = "300" height = "auto" data-large="./img/works/large/5.jpg" alt="Movie 1">
<div class="overlay">
<h4>Bac Kinh</h4>
</div>
</div>
</div>
<div class="work-item">
<div class="work-item-inner">
<img src="https://i.postimg.cc/jSn4r1Hz/6.jpg" width = "300" height = "auto" data-large="./img/works/large/6.png" alt="Movie 1">
<div class="overlay">
<h4>Trung Khanh</h4>
</div>
</div>
</div>
</div>
</div>
</section>
<!--top rated end -->
<!--contact section start-->
<section class="contact-section" id="contact">
<div class="container">
<div class="row">
<div class="img-box">
<div class="section-title">
<h1>Contact Us</h1>
</div>
</div>
</div>
</div>
<div class="row">
<div class="contact-form">
<form class="form">
<div class="row">
<div class="left input-group">
<label>Name</label>
<input type="text" placeholder="Your Name Here" class="input-control">
</div>
<div class="right input-group">
<label>Email or Phone</label>
<input type="text" placeholder="Your Email or Phone Here" class="input-control">
</div>
</div>
<div class="row">
<div class="left input-group">
<label>Message</label>
<textarea class="input-control" placeholder="Your Message Here"></textarea>
</div>
</div>
<div class="form-btn">
<button type="button" class="btn btn-01" id="button">Send Message</button>
</div>
<div id="dialog">
I know you know this, but you are awesome. As we say au revoir to another #ResearchPride month,
</div>
</form>
</div>
</div>
<div class="row">
<div class="contact-info">
<div class="row">
<div class="info-item">
<h5>Address</h5>
<p>X5 T7 U8 USA</p>
</div>
<div class="info-item">
<h5>Phone</h5>
<p>090 8403 1789</p>
</div>
<div class="info-item">
<h5>Email</h5>
<p>maviemanie#mivie.com</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="social-links">
<img src="https://i.postimg.cc/6Q9JPCRx/facebook.png" width = "100" height = "auto" alt="facebook">
<img src="https://i.postimg.cc/zBvmz50d/twitter.png" width = "100" height = "auto" alt="twitter">
<img src="https://i.postimg.cc/7Pc4LGvS/linkedin.png" width = "100" height = "auto" alt="linkedin">
<img src="https://i.postimg.cc/rsdLJc4d/intagram.jpg" width = "200" height = "auto" alt="intagram">
</div>
</div>
</section>
<p class="copyright">© 2022 Movie Mania</p>
<!--light box start-->
<div class="lightbox">
<div class="img-box">
<div class="lightbox-close">×</div>
<img src="https://i.postimg.cc/qML93zSm/2.png" width = "100" height = "auto" class="lightbox-img" alt="img1">
<div class="lightbox-caption">
<div class="lightbox-category">
</div>
<div class="lightbox-counter">
</div>
</div>
<div class="lightbox-controls">
<div class="prev">
<img src="https://i.postimg.cc/W4XLct6F/previous.png" width = "100" height = "auto" alt="previous">
</div>
<div class="next">
<img src="https://i.postimg.cc/QdZrp2dt/next.png" width = "100" height = "auto" alt="next">
</div>
</div>
</div>
</div>
<!--light box end -->
</body>

css3 transform width hover do not working?

I'm trying to animate the width of the span inside the an of this link.
The same demo: https://www.khaneyeax.com/en
.lang {
background-color: rgba(255,255,255,0.1);
left: -130px;
top: 400px;
}
.lang a {
padding: 10px;
color: black;
max-width: 0;
display: block;
overflow: hidden;
white-space: nowrap;
transition: max-width 1s ease-in-out;
}
.lang a:hover {
width: 300px;
max-width: 300px;
}
<div id="left">
<img src="https://via.placeholder.com/150">
<div class="position-fixed lang">
Language Persian FA
<a class="english">Language English EN</a>
<a class="search"><i class="fas fa-search"></i> Advanced Search </a>
</div>
</div>

Transform signature with divs to table

I have a small script that generates signatures for mail, but after testing the same in Outlook, it does not recognize the divs, and some other tags.
I'm breaking my head and I can not simulate this signature on a table.
can you help me? Please!
Signature code:
#import url('https://fonts.googleapis.com/css?family=Roboto+Condensed');
#sigCelu{
position: absolute;
left: 92px !important;
top: -1px;
width: 140px;
}
#new_sign{
font-family: 'Roboto Condensed', sans-serif;
width: 100%;
height: auto;
position: relative;
color: #333333 !important;
display: block;
}
#new_sign img{
position: relative;
display: block;
margin-bottom: 5px;
}
#new_sign .barra{
width: 3px;
height: 150px;
background-color: #004375;
position: relative;
display: block;
float: left;
margin-right: 5px;
}
#new_sign .barra2{
width: 3px;
height: 50px;
background-color: #28aa76;
position: relative;
display: block;
float: left;
}
#new_sign #info_sign{
position: relative;
display: block;
margin: 5px 0px 0px 15px;
}
#new_sign #info_sign p span{
position: relative;
display: inline-block;
margin-bottom: 5px;
}
#info_sign img{
position: relative;
display: block;
width: 30px;
height: 30px;
margin-left: -5px;
}
.logos{
margin-top: -7px;
position: relative;
}
#info_sign .logos > span{
position: absolute;
top: 12%;
left: 23px;
}
<div id="new_sign">
<img src="https://i.imgur.com/j4oT9Lz.png" id="sigFoto" alt="logo">
<i class="barra"></i>
<i class="barra2"></i>
<div id="info_sign">
<h3 id="sigName">Nome Aqui</h3>
<p>
<span id="sigTitle">Texto aqui /</span>
<span id="sigCompany">Texto aqui</span>
</p>
<div class="logos">
<img src="https://caoa.com.br/temp/images/icone-telefone.png" alt="#">
<span id="sigMobile">(11) 0000-0000</span>
<span id="celular2">
<span id="sigCelu">| (11) 90000-0000</span>
</span>
</div>
<div class="logos">
<img src="https://caoa.com.br/temp/images/icone-email.png" alt="#">
<span>
<a id="sigEmail">teuemail</a>
</span>
</div>
<div class="logos">
<img src="https://caoa.com.br/temp/images/icone-email-site.png">
<span id="sigWebsite">www.site.com.br</span>
</div>
<div class="logos">
<img src="https://caoa.com.br/temp/images/icone-email-local.png" alt="#">
<span id="sigAddress">Rua, <span id="numero">2822</span>, restante</span>
</div>
</div>
</div>
I can not get familiar with these tables, I believe that because I started right in html5, without messing with tables so much, I've tried several times, consecutive hours working on the code and I do not get a result :(

Fill empty spaces with sibling elements using CSS

I'm trying to create a mosaic of images, but i'm having a hard time positioning them.
The elements i'm using are floated left, have different sizes and are following a specific display order. Is there a way of doing it using only CSS?
This is how i want it to be:
And this is how it is right now:
Finally, what i've coded so far:
span {
font-family: Arial;
}
.mosaic_wrapper {
float: left;
clear: both;
overflow: hidden;
width: 100%;
max-width: 1075px;
margin-bottom: 50px;
}
.mosaic_wrapper div {
float: left;
width: 100%
}
.mosaic_wrapper div .image_wrapper {
width: 48%;
height: 400px;
float: left;
position: relative;
margin: 0.5% 0.5%;
overflow: hidden;
}
.mosaic_wrapper div .image_wrapper a {
width: 100%;
height: 100%;
float: left;
}
.mosaic_wrapper div .image_wrapper a:hover img {
transform: scale(1.1);
}
.mosaic_wrapper div .image_wrapper a:hover span.bg {
opacity: 0.5;
}
.mosaic_wrapper div .image_wrapper a img {
float: left;
width: 100%;
height: 100%;
transition: transform 0.4s ease-in-out;
backface-visibility: hidden;
filter: grayscale(0%);
}
.mosaic_wrapper div .image_wrapper a span.bg {
background-image: linear-gradient(to bottom, #999999, #222222);
opacity: 0;
position: absolute;
width: 100%;
height: 100%;
top: 0;
z-index: 5;
display: block;
transition: opacity 0.3s ease;
}
.mosaic_wrapper div .image_wrapper a div.text {
color: #ffffff;
position: absolute;
font-size: 1.7rem;
bottom: 0;
z-index: 10;
padding: 20px;
box-sizing: border-box;
width: 100%;
}
.mosaic_wrapper div .image_wrapper a div.text span {
float: left;
width: 100%;
}
.mosaic_wrapper div .image_wrapper a div.text span.parent {
font-size: 14px;
text-transform: uppercase;
}
.mosaic_wrapper div .image_wrapper a div.text span.dept {
font-size: 50px;
font-weight: bold;
line-height: 1.1;
}
.mosaic_wrapper div .image_wrapper a div.text span.desc {
font-size: 14px;
line-height: 1.2;
}
<div class="mosaic_wrapper">
<div>
<div class="image_wrapper" style="width: 58%;">
<a href="#">
<img src="http://placehold.it/623x400">
<div class="text">
<span class="parent">Test</span>
<span class="dept">Test</span>
<span class="desc">Test</span>
</div>
<span class="bg"></span>
</a>
</div>
<div class="image_wrapper" style="width: 40%;height: 800px;">
<a href="#">
<img src="http://placehold.it/430x800">
<div class="text">
<span class="parent">Test</span>
<span class="dept">Test</span>
<span class="desc">Test</span>
</div>
<span class="bg"></span>
</a>
</div>
<div class="image_wrapper" style="width: 28%;">
<a href="#">
<img src="http://placehold.it/300x400">
<div class="text">
<span class="parent">Test</span>
<span class="dept">Test</span>
<span class="desc">Test</span>
</div>
<span class="bg"></span>
</a>
</div>
<div class="image_wrapper" style="width: 29%;">
<a href="#">
<img src="http://placehold.it/300x400">
<div class="text">
<span class="parent">Test</span>
<span class="dept">Test</span>
<span class="desc">Test</span>
</div>
<span class="bg"></span>
</a>
</div>
<div class="image_wrapper" style="width: 100%;">
<a href="#">
<img src="http://placehold.it/1075x400">
<div class="text">
<span class="parent">Test</span>
<span class="dept">Test</span>
<span class="desc">Test</span>
</div>
<span class="bg"></span>
</a>
</div>
</div>
</div>
Can someone please help?
Thanks in advance!
Add a float:right to the 430x800 mosaic;
<div class="image_wrapper" style="width: 40%;height: 800px;float:right">
<a href="#">
<img src="http://placehold.it/430x800">
<div class="text">
<span class="parent">Test</span>
<span class="dept">Test</span>
<span class="desc">Test</span>
</div>
<span class="bg"></span>
</a>
</div>
Alternatively you can add an id attribute to the 430x800 mosaic like id="rightMosaic"and create this style for it:
.mosaic_wrapper div .image_wrapper#rightMosaic{
float: right;
}
And of corse remove it from the inline style
I would use flex rows and columns to lay this out. Adjusted your image dimensions a little so everything will line up
* {
margin:0;padding:0;box-sizing:border-box;
}
.flex {
display: flex;
}
.col {
flex-direction: column;
}
img {
max-width: 100%;
display: block;
}
<div class="flex" style="margin: 0 0 12px;">
<div class="flex col" style="margin: 0 12px 0 0;">
<div style="margin: 0 0 12px 0;">
<img src="http://placehold.it/612x400">
</div>
<div class="flex">
<div style="margin: 0 12px 0 0;">
<img src="http://placehold.it/300x400">
</div>
<div>
<img src="http://placehold.it/300x400">
</div>
</div>
</div>
<div>
<img src="http://placehold.it/430x812">
</div>
</div>
<div>
<img src="http://placehold.it/1054x400">
</div>

Hover Effect Transform property

I am trying to make a gallery, the links show up from the bottom on
hover. I am having trouble regarding hiding them when they are not on hover.
I am trying to make a gallery, the links show up from the bottom on
hover. I am having trouble regarding hiding them when they are not on hover.
I am trying to make a gallery, the links show up from the bottom on
hover. I am having trouble regarding hiding them when they are not on hover.
I am trying to make a gallery, the links show up from the bottom on
hover. I am having trouble regarding hiding them when they are not on hover.
I am trying to make a gallery, the links show up from the bottom on
hover. I am having trouble regarding hiding them when they are not on hover.
.imageWrapper {
position: relative;
width: 200px;
height: 200px;
display: inline-block;
padding: 0px;
margin: 0px;
}
.imageWrapper img {
display: block;
width: 200px;
height: 200px;
padding: 0px;
margin: 0px;
}
.imageWrapper .cornerLink {
height:100px;
width:200px;
opacity: 0.7;
position: absolute;
bottom: 0px;
left: 0px;
margin: 0;
padding: 0;
color: #ffffff;
background-color: cadetblue;
text-decoration: none;
text-align: center;
transform: translateX(0) translateY(100px) translateZ(0);
transition-duration:0.3s;
transition-property: transform;
}
.imageWrapper:hover .cornerLink {
transform: translateX(0) translateY(0) translateZ(0);
}
a{
color: #ffffff;
text-decoration: none;
text-align: center;
}
<body>
<main>
<div class="imageWrapper">
<img src="http://placehold.it/200x200" alt="" />
<div class="cornerLink">
Link
</div>
</div>
<div class="imageWrapper">
<img src="http://placehold.it/200x200" alt="" />
<div class="cornerLink">
Link
</div>
</div>
<div class="imageWrapper">
<img src="http://placehold.it/200x200" alt="" />
<div class="cornerLink">
Link
</div>
</div>
<div class="imageWrapper">
<img src="http://placehold.it/200x200" alt="" />
<div class="cornerLink">
Link
</div>
</div>
</main>
</body>
Add overflow:hidden; to your .imageWrapper class. Here's working code:
.imageWrapper {
position: relative;
width: 200px;
height: 200px;
display: inline-block;
padding: 0px;
margin: 0px;
overflow:hidden;
}
.imageWrapper img {
display: block;
width: 200px;
height: 200px;
padding: 0px;
margin: 0px;
}
.imageWrapper .cornerLink {
height:100px;
width:200px;
opacity: 0.7;
position: absolute;
bottom: 0px;
left: 0px;
margin: 0;
padding: 0;
color: #ffffff;
background-color: cadetblue;
text-decoration: none;
text-align: center;
transform: translateX(0) translateY(100px) translateZ(0);
transition-duration:0.3s;
transition-property: transform;
}
.imageWrapper:hover .cornerLink {
transform: translateX(0) translateY(0) translateZ(0);
}
a{
color: #ffffff;
text-decoration: none;
text-align: center;
}
<body>
<main>
<div class="imageWrapper">
<img src="http://placehold.it/200x200" alt="" />
<div class="cornerLink">
Link
</div>
</div>
<div class="imageWrapper">
<img src="http://placehold.it/200x200" alt="" />
<div class="cornerLink">
Link
</div>
</div>
<div class="imageWrapper">
<img src="http://placehold.it/200x200" alt="" />
<div class="cornerLink">
Link
</div>
</div>
<div class="imageWrapper">
<img src="http://placehold.it/200x200" alt="" />
<div class="cornerLink">
Link
</div>
</div>
</main>
</body>
Change this line transform: translateX(0) translateY(100px) translateZ(0); to transform: translateX(0) translateY(115px) translateZ(0);:
Add overflow:hidden to .imageWrapper to remove the space under images
.imageWrapper {
position: relative;
width: 200px;
height: 200px;
display: inline-block;
padding: 0px;
margin: 0px;
overflow: hidden; /* Hides links when off image */
}
.imageWrapper img {
display: block;
width: 200px;
height: 200px;
padding: 0px;
margin: 0px;
}
.imageWrapper .cornerLink {
height: 100px;
width: 200px;
opacity: 0.7;
position: absolute;
bottom: 0px;
left: 0px;
margin: 0;
padding: 0;
color: #ffffff;
background-color: cadetblue;
text-decoration: none;
text-align: center;
transform: translateX(0) translateY(100px) translateZ(0);
transition-duration: 0.3s;
transition-property: transform;
}
.imageWrapper:hover .cornerLink {
transform: translateX(0) translateY(0) translateZ(0);
}
a {
color: #ffffff;
text-decoration: none;
text-align: center;
}
<body>
<main>
<div class="imageWrapper">
<img src="http://placehold.it/200x200" alt="" />
<div class="cornerLink">
Link
</div>
</div>
<div class="imageWrapper">
<img src="http://placehold.it/200x200" alt="" />
<div class="cornerLink">
Link
</div>
</div>
<div class="imageWrapper">
<img src="http://placehold.it/200x200" alt="" />
<div class="cornerLink">
Link
</div>
</div>
<div class="imageWrapper">
<img src="http://placehold.it/200x200" alt="" />
<div class="cornerLink">
Link
</div>
</div>
</main>
</body>