Center a container row on bootstrap - html

I read online that you can use the below code to center a row in a container using bootstrap, but I haven't been able to get it to work and I think it might have something to do with the css.
<div class="row justify-content-center">
Below is the current code. There was no .portfolio in the template and it won't let me add it.
.portfolio #portfolio-flters {
padding: 0;
width: 50%;
margin: auto;
list-style: center;
text-align: center;
border-radius: 50px;
}
.portfolio #portfolio-flters li {
cursor: pointer;
display: inline-block;
padding: 10px 15px;
font-size: 15px;
font-weight: 500;
line-height: 1;
text-transform: uppercase;
color: #444444;
width: 50%;
margin: auto;
margin-bottom: 5px;
transition: all 0.3s ease-in-out;
font-family: "Poppins", sans-serif;
}
.portfolio #portfolio-flters li:hover,
.portfolio #portfolio-flters li.filter-active {
color: #593d4a;
}
.portfolio #portfolio-flters li:last-child {
margin-right: 0;
}
.portfolio .portfolio-item {
margin-bottom: 30px;
}
.portfolio .portfolio-item .portfolio-info {
opacity: 0;
position: absolute;
left: 30px;
right: 30px;
margin: auto;
width: 20%;
text-align: center;
bottom: 0;
z-index: 3;
transition: all ease-in-out 0.3s;
background: rgba(255, 255, 255, 0.9);
padding: 15px;
}
.portfolio .portfolio-item .portfolio-info h4 {
font-size: 12px;
color: #fff;
font-weight: 600;
color: #191919;
}
.portfolio .portfolio-item .portfolio-info p {
color: #4c4c4c;
font-size: 14px;
margin-bottom: 0;
}
.portfolio .portfolio-item .portfolio-info .preview-link,
.portfolio .portfolio-item .portfolio-info .details-link {
position: absolute;
right: 40px;
font-size: 24px;
top: calc(50% - 18px);
color: #333333;
}
.portfolio .portfolio-item .portfolio-info .preview-link:hover,
.portfolio .portfolio-item .portfolio-info .details-link:hover {
color: #593d4a;
}
.portfolio .portfolio-item .portfolio-info .details-link {
right: 10px;
}
.portfolio .portfolio-item .portfolio-links {
opacity: 0;
left: 0;
right: 0;
text-align: center;
z-index: 3;
position: absolute;
transition: all ease-in-out 0.3s;
}
.portfolio .portfolio-item .portfolio-links a {
color: #fff;
margin: 0 2px;
font-size: 28px;
display: inline-block;
transition: 0.3s;
}
.portfolio .portfolio-item .portfolio-links a:hover {
color: #593d4a;
}
.portfolio .portfolio-item:hover .portfolio-info {
opacity: 1;
bottom: 20px;
}
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/bootstrap#5.2.3/dist/css/bootstrap.min.css">
<section id="dataviz/wordclouds" class="portfolio">
<p></p>
<div class="container">
<h3>Word Clouds</h3>
<div class="portfolio-container" data-aos="fade-up" data-aos-delay="150">
<div class="row justify-content-center">
<div class="col-lg-4 portfolio-item filter-wc">
<img src="https://via.placeholder.com/300x100" class="img-fluid" alt="">
<div class="portfolio-info">
<h4>20 Nov</h4>
</div>
</div>
<div class="col-lg-4 portfolio-item filter-wc">
<img src="https://via.placeholder.com/300x100" class="img-fluid" alt="">
<div class="portfolio-info">
<h4>21 Nov</h4>
</div>
</div>
<div class="col-lg-4 portfolio-item" filter-wc>
<img src="https://via.placeholder.com/300x100" class="img-fluid" alt="">
<div class="portfolio-info">
<h4>22 Nov</h4>
</div>
</div>
<div class="col-lg-4 portfolio-item filter-wc">
<img src="https://via.placeholder.com/300x100" class="img-fluid" alt="">
<div class="portfolio-info">
<h4>23 Nov</h4>
</div>
</div>
<div class="col-lg-4 portfolio-item filter-wc">
<img src="https://via.placeholder.com/300x100" class="img-fluid" alt="">
<div class="portfolio-info">
<h4>24 Nov</h4>
</div>
</div>
</div>
</div>
</section>
And this is an image of the problem, the last row isn't centered:
Thank you so much in advance for the help!

Related

Nav-links clickable but not visible in Mobile View

The screenshot of the error The nav-links in mobile view do not appear but are clickable. New to HTML and CSS. The Ham-burger menu has z-index 1 it appears correctly. But the content of the menu do not appear. This error is in mobile view only. Attached media query code in css. The name of the stylesheet is different from that in my pc so that isn't an issue.
HTML code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset= "UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Executive Committee</title>
<link href="lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link href="style2.css" rel="stylesheet">
<style>
.our-team{
padding: 30px 0 40px;
background: #fff;
overflow: hidden;
position: relative;
}
.our-team .pic{
width: 130px;
height: 130px;
margin-bottom: 50px;
position: relative;
z-index: 1;
margin: auto;
}
.our-team .pic:before{
content:"";
width: 100%;
background: #004165;
position: absolute;
bottom: 135%;
right: 0;
left: 0;
transform: scale(3);
transition: all 0.3s linear 0s;
}
.our-team:hover .pic:before{
height: 100%;
}
.our-team .pic:after{
content: "";
width: 100%;
height: 100%;
border-radius: 50%;
background: #004165;
position: absolute;
top: 0;
left: 0;
z-index: -1;
}
.our-team .pic img{
width: 100%;
height: auto;
border-radius: 50%;
transform: scale(1);
transition: all 0.9s ease 0s;
}
.our-team:hover .pic img{
box-shadow: 0 0 0 14px #f7f5ec;
transform: scale(0.7);
}
.our-team .team-content{
padding-top: 30px;
margin-bottom: 30px;
}
.our-team .title{
font-size: 22px;
font-weight: 700;
color: #4e5052;
letter-spacing: 1px;
text-transform: capitalize;
margin-bottom: 5px;
padding: 10px 10px 10px 10px;
}
.our-team .post{
display: block;
font-size: 15px;
color: #4e5052;
text-transform: capitalize;
padding: 10px 10px 10px 10px;
}
.our-team .social{
width: 100%;
padding: 0;
margin: 0;
background: #004165;
position: absolute;
bottom: -100px;
left: 0;
transition: all 0.5s ease;
}
.our-team:hover .social{
bottom: 0;
}
.our-team .social li{
display: inline-block;
}
.our-team .social li a{
display: block;
padding: 10px;
font-size: 17px;
color: #fff;
transition: all 0.3s ease 0s;
}
.our-team .social li a:hover{
color: #eb1768;
background: #f7f5ec;
text-decoration: none;
}
</style>
</head>
<body>
<nav>
<div class="logo">
<img src="images/TMxAU.png" alt="">
</div>
<div class="hamburger">
<div class="line"></div>
<div class="line"></div>
<div class="line"></div>
</div>
<ul class="nav-links">
<li>Home</li>
<li>Club Etiquette</li>
<li>Achievements</li>
<li>Executive Committee</li>
<li>Pathways</li>
<li>Resources</li>
</ul>
</nav>
<section class="landing">
<div>Alone we can do so little, together we can do so much.</div>
</section>
<script src="app.js"></script>
<section class="pathwayarea">
<div class="container">
<!-- Page Heading -->
<h1 class="my-4">Team</h1>
<br><br>
<section class="">
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-4 col-sm-6 mb-4">
<div class="our-team">
<div class="pic">
<img src ="images\Team\1.png">
</div>
<div class="team-content">
<h3 class ="title">ABCD/h3>
<span class="post">Role1</span>
</div>
<ul class="social">
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
<div class="col-lg-3 col-md-4 col-sm-6 mb-4">
<div class="our-team">
<div class="pic">
<img src ="images\Team\2.png">
</div>
<div class="team-content">
<h3 class ="title">ABCD</h3>
<span class="post">Role2</span>
</div>
<ul class="social">
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
<div class="col-lg-3 col-md-4 col-sm-6 mb-4">
<div class="our-team">
<div class="pic">
<img src ="images\Team\3.png">
</div>
<div class="team-content">
<h3 class ="title">ABCD</h3>
<span class="post">Role3</span>
</div>
<ul class="social">
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
<div class="col-lg-3 col-md-4 col-sm-6 mb-4">
<div class="our-team">
<div class="pic">
<img src ="images\Team\4.png">
</div>
<div class="team-content">
<h3 class ="title">ABCD</h3>
<span class="post">Role5</span>
</div>
<ul class="social">
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
<div class="col-lg-3 col-md-4 col-sm-6 mb-4">
<div class="our-team">
<div class="pic">
<img src ="images\Team\6.png">
</div>
<div class="team-content">
<h3 class ="title">ABCD</h3>
<span class="post">Role6</span>
</div>
<ul class="social">
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
<div class="col-lg-3 col-md-4 col-sm-6 mb-4">
<div class="our-team">
<div class="pic">
<img src ="images\Team\7.png">
</div>
<div class="team-content">
<h3 class ="title">ABCD</h3>
<span class="post">Role7</span>
</div>
<ul class="social">
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
<div class="col-lg-3 col-md-4 col-sm-6 mb-4">
<div class="our-team">
<div class="pic">
<img src ="images\Team\8.png">
</div>
<div class="team-content">
<h3 class ="title">ABCD</h3>
<span class="post">Role8</span>
</div>
<ul class="social">
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
<div class="col-lg-3 col-md-4 col-sm-6 mb-4">
<div class="our-team">
<div class="pic">
<img src ="images\Team\9.png">
</div>
<div class="team-content">
<h3 class ="title">ABCD</h3>
<span class="post">Role9</span>
</div>
<ul class="social">
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
</div>
</div>
</section>
</div>
</section>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</body>
<footer id="footer">
<div class="footer-top">
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-6 footer-info">
<h3>Club Name Here</h3>
<p>ABCD</p>
</div>
<div class="col-lg-3 col-md-6 footer-links">
<h4>Useful Links</h4>
<ul>
<li><i class="ion-ios-arrow-right"></i> Home</li>
<li><i class="ion-ios-arrow-right"></i> Club Etiquette</li>
<li><i class="ion-ios-arrow-right"></i> Achievements</li>
<li><i class="ion-ios-arrow-right"></i> Executive Committee</li>
<li><i class="ion-ios-arrow-right"></i> Pathways</li>
<li><i class="ion-ios-arrow-right"></i> Resources</li>
</ul>
</div>
<div class="col-lg-3 col-md-6 footer-contact">
<h4>Contact Us</h4>
<p>Contact Text here/p>
<div class="social-links">
<i class="fa fa-twitter"></i>
<i class="fa fa-facebook"></i>
<i class="fa fa-instagram"></i>
<i class="fa fa-linkedin"></i>
</div>
</div>
<div class="col-lg-3 col-md-6 footer-newsletter">
<h4>Interested in learning more?</h4>
<p>Drop us your E-Mail ID and we'll get in touch with you.</p>
<form action="" method="post">
<input type="email" name="email"><input type="submit" value="Submit">
</form>
</div>
</div>
</div>
</div>
</footer>
</html>
CSS code
* {
margin: 0;
padding: 0;
box-sizing: border-box;[enter image description here][1]
}
body {
font-family: sans-serif;
}
nav {
height: 10vh;
}
.nav-links {
display: flex;
list-style: none;
width: 50%;
height: 100%;
justify-content: space-around;
align-items: center;
margin-left: auto;
}
.pathwayarea{
background: #a9b2b1;
padding-top: 10px;
}
.nav-links li a {
color: #000;
text-decoration: none;
font-size: 16px;
font-weight: bold;
padding: 5px 20px;
}
.nav-links li a:hover{
background: #772432;
color: #fff;
}
.landing {
height: 90vh;
display: flex;
justify-content: center;
width: inherit;
align-items: center;
background: linear-gradient(0deg, rgba(242,223,116,1) 55%, rgba(255,255,255,1) 100%);
}
.container h1{
text-align: center;
font-weight: bold;
color: #000;
}
.logo img{
width: 300px;
float: left;
height: auto;
margin-top: 10px;
margin-left: 30px;
}
.landing div{
top: 50%;
transform: translateY(-50%);
text-align: center;
font-weight: bold;
font-size: 3rem;
}
#footer {
background: #000;
padding: 0 0 30px 0;
color: #eee;
font-size: 14px;
}
#footer .footer-top {
background: #111;
padding: 60px 0 30px 0;
}
#footer .footer-top .footer-info {
margin-bottom: 30px;
}
#footer .footer-top .footer-info h3 {
font-size: 34px;
margin: 0 0 20px 0;
padding: 2px 0 2px 10px;
line-height: 1;
font-family: "Myriad Pro";
font-weight: 700;
letter-spacing: 3px;
border-left: 4px solid #cd202c;
}
#footer .footer-top .footer-info p {
font-size: 14px;
line-height: 24px;
margin-bottom: 0;
font-family: "Montserrat", sans-serif;
color: #fff;
}
#footer .footer-top .social-links a {
font-size: 18px;
display: inline-block;
background: #333;
color: #eee;
line-height: 1;
padding: 8px 0;
margin-right: 4px;
border-radius: 50%;
text-align: center;
width: 36px;
height: 36px;
transition: 0.3s;
}
#footer .footer-top .social-links a:hover {
background: #fff;
color: #fff;
}
#footer .footer-top h4 {
font-size: 14px;
font-weight: bold;
color: #fff;
text-transform: uppercase;
position: relative;
padding-bottom: 12px;
}
#footer .footer-top h4::before,
#footer .footer-top h4::after {
content: '';
position: absolute;
left: 0;
bottom: 0;
height: 2px;
}
#footer .footer-top h4::before {
right: 0;
background: #555;
}
#footer .footer-top h4::after {
background: #cd202c;
width: 60px;
}
#footer .footer-top .footer-links {
margin-bottom: 30px;
}
#footer .footer-top .footer-links ul {
list-style: none;
padding: 0;
margin: 0;
}
#footer .footer-top .footer-links ul i {
padding-right: 8px;
color: #ddd;
}
#footer .footer-top .footer-links ul li {
border-bottom: 1px solid #333;
padding: 10px 0;
font-family: "Myriad Pro";
}
#footer .footer-top .footer-links ul li:first-child {
padding-top: 0;
}
#footer .footer-top .footer-links ul a {
color: #eee;
}
#footer .footer-top .footer-links ul a:hover {
color: #fff;
}
#footer .footer-top .footer-contact {
margin-bottom: 30px;
font-family: "Myriad Pro";
}
#footer .footer-top .footer-contact p {
line-height: 26px;
font-family: "Myriad Pro";
}
#footer .footer-top .footer-newsletter {
margin-bottom: 30px;
font-family: "Myriad Pro";
}
#footer .footer-top .footer-newsletter input[type="email"] {
border: 0;
padding: 6px 8px;
width: 65%;
font-family: "Myriad Pro";
}
#footer .footer-top .footer-newsletter input[type="submit"] {
background: #cd202c;
border: 0;
width: 35%;
padding: 6px 0;
text-align: center;
color: #fff;
transition: 0.3s;
cursor: pointer;
font-family: "Myriad Pro";
}
#media screen and (max-width: 768px) {
.landing div{
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
}
.landing {
position: relative;
width: 100%;
}
.landing img{
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
}
.line {
width: 30px;
height: 3px;
background: #000;
margin: 5px;
padding-left: 5px;
}
nav {
position: relative;
}
.hamburger {
position: absolute;
cursor: pointer;
right: 5%;
top: 50%;
transform: translate(-5%, -50%);
z-index: 3;
}
.nav-links {
position: fixed;
background: #f2df74;
height: 100vh;
width: 100%;
flex-direction: column;
clip-path: circle(100px at 90% -10%);
-webkit-clip-path: circle(100px at 90% -19%);
transition: all 1s ease-out;
pointer-events: none;
}
.nav-links.open {
clip-path: circle(1000px at 90% -10%);
-webkit-clip-path: circle(1000px at 90% -10%);
pointer-events: all;
z-index: 2;
}
.landing {
}
.nav-links li {
opacity: 0;
}
.nav-links li a {
font-size: 25px;
}
.nav-links li:nth-child(1) {
transition: all 0.5s ease 0.2s;
}
.nav-links li:nth-child(2) {
transition: all 0.5s ease 0.4s;
}
.nav-links li:nth-child(3) {
transition: all 0.5s ease 0.6s;
}
.nav-links li:nth-child(4) {
transition: all 0.5s ease 0.6s;
}
.nav-links li:nth-child(5) {
transition: all 0.5s ease 0.6s;
}
.nav-links li:nth-child(6) {
transition: all 0.5s ease 0.6s;
}
li.fade {
opacity: 1;
}
}
First, a few observations:
You are using different versions of Bootstrap: in CSS: 4.3.1 and JS: 3.3.7.
The footer is in the wrong place, you need to place it before closing the </body> tag.
As you are using Bootstrap why not use the navbar?
To fix your problem just remove the opacity from .nav-links li or set to 1:
.nav-links li {
opacity: 1;
}
EDIT:
Add this to the respective classes:
.nav-links {
visibility: hidden;
opacity: 0;
z-index: 1;
}
.nav-links.open {
opacity: 1;
visibility: visible;
}
And remove this:
.nav-links li {
opacity: 0;
}
li.fade {
opacity: 1;
}
Now it should work as expected.
Working example: Codepen.

Hamburger Overlay menu animation

I'm creating an animation for a website menu. I created much of it, But The problem is when the overlay animation starts, the content appears earlier. The content should appear as the overlay animation moves from left to right. For reference, please check the menu animation here, https://www.mission-haut-brion.com, Below is the code that I have tried. Any help would be appreciated.
You can find a working fiddle here of the code. https://jsfiddle.net/dk724f6p/.
<header>
<div >
<h1><img style="" src="assets/img/logo.jpg"></h1>
REFERENCES
<a onclick="openNav()" style="filter: brightness(1);" href="#">
<i ></i>
<i ></i>
<i ></i>
</a>
</div>
<div id="myNav" class="overlay45">
<header >
×
<div id="overlay-content" >
<div ></div>
<div >
<div>
<div >
<img src="assets/img/logo2.png>
</div>
</div>
<div >
<div></div>
<div>
<a id="menu-anim-fix">Home Page</a>
</div>
<div>
<a>Our Offer</a>
</div>
<div></div>
</div>
<div>
<div></div>
<div>
<a id="menu-anim-fix" href="ourwork.html">Our Work</a>
</div>
<div class="col-sm-12 col-md-4" style="text-align: right;">
<a id="menu-anim-fix" href="stepform.html">Order Us</a>
</div>
<div class="col-sm-12 col-md-2"></div>
</div>
<div class="row mb-5">
<div class="col-sm-12 col-md-2"></div>
<div class="col-sm-12 col-md-4">
<a id="menu-anim-fix" href="website-art.html">Website Art</a>
</div>
<div class="col-sm-12 col-md-4" style="text-align: right;">
Contact Us
</div>
<div class="col-sm-12 col-md-2"></div>
</div>
<div class="row">
<div class="col-sm-12 col-md-12" style="text-align: center;">
<a id="menu-anim-fix" href="refrences.html">REFERENCES</a>
</div>
</div>
<div class="row mt-5">
<div class="col-md-12 mt-5" style="text-align: center;">
<p class="mt-5" style="color: #fff;font-size: 12px;">2019- All Rights Reserved</p>
</div>
</div>
</div>
<div class="col-md-2" style="border-left: 1px solid #fff" ></div>
</div>
</header>
</div>
</header>
<script>
function openNav() {
document.getElementById("myNav").style.width = "100%";
setTimeout(function(){
document.getElementById("overlay-content").style.display = "flex";
// document.getElementById("menu-anim-fix").style.display = "flex";
}, 100);
}
function closeNav() {
document.getElementById("myNav").style.width = "0%";
document.getElementById("overlay-content").style.display = "none";
}
</script>
</body>
</html>
header a {
letter-spacing: 8px;
text-transform: uppercase;
color: #fff;
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
-ms-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
transition: all 0.3s ease;
text-decoration:none !important;
}
header a:hover {
color: #d3a356;
letter-spacing: 10px;
}
.overlay45 {
height: 100%;
width: 0;
position: fixed;
z-index: 49;
top: 0;
left: 0;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0, 0.9);
overflow-x: hidden;
transition: 1s;
}
.overlay-content{
transition: 1s;
}
.overlay45 a {
display: block;
transition: 0.3s;
}
/*.overlay-content {
position: relative;
width: 100%;
}*/
.overlay45 .closebtn {
position: absolute;
top: -10px;
right: 65px;
font-size: 60px;
z-index: 50;
}
#media screen and (max-height: 450px) {
.overlay45 a {font-size: 20px}
.overlay45 .closebtn {
font-size: 40px;
top: 15px;
right: 35px;
}
}
#media screen and (max-width: 600px) {
.overlay45 .closebtn {
position: absolute;
top: -10px;
right: 20px;
font-size: 60px;
z-index: 50;
}
}
#media screen and (max-width: 767px) {
header .col-sm-12 {
text-align: center !important;
}
header .col-md-2 {
border-right: none !important;
border-left: none !important;
}
}
.refrences-website-fix{
padding-top: 10%;
}
.refrences-website-fix a{
font-size: 35px;
font-weight: 900;
}
.refrences-website-fix .corvin:hover
{
background-image: url(../img/logo.jpg);
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.header-top {
padding: 0 10px !important;
}
.header-top img{
width: 50px;
height: 50px;
}
#media screen and (max-width: 760px) {
.header-top img{
width: 80px;
height: 80px;
}
}
.header-top {
padding: 0 60px;
position: fixed;
top: 0;
width: 100%;
z-index: 16;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.header-top a{
/*color: grey !important;*/
}
.header-top i{
background: #fff !important;
}
h1 {
line-height: 70px;
height: 70px;
}
h1 a {
display: block;
padding: 0 10px;
}
.toggle-menu {
width: 50px;
height: 50px;
display: inline-block;
position: relative;
top: 20px;
}
.toggle-menu i {
position: absolute;
display: block;
height: 2px;
background: white;
width: 24px;
left: 10px;
-webkit-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
}
.toggle-menu i:nth-child(1) {
top: 16px;
}
.toggle-menu i:nth-child(2) {
top: 24px;
}
.toggle-menu i:nth-child(3) {
top: 32px;
}
/*.open-menu i:nth-child(1) {
top: 25px;
-webkit-transform: rotateZ(45deg);
-ms-transform: rotate(45deg);
transform: rotateZ(45deg);
}
.open-menu i:nth-child(2) {
background: transparent !important;
}
.open-menu i:nth-child(3) {
top: 25px;
-webkit-transform: rotateZ(-45deg);
-ms-transform: rotate(-45deg);
transform: rotateZ(-45deg);
}*/
nav {
height: 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
background:#000;
position: fixed;
width: 100%;
/* -webkit-transition: all 1s;
-o-transition: all 1s;
transition: all 1s;*/
visibility: hidden;
opacity: 0;
-webkit-transition: opacity 1s, visibility 0s 1s;
transition: opacity 1s, visibility 0s 1s;
z-index: 15;
}
.clearfix:before,
.clearfix:after {
content: "";
display: table;
}
.clearfix:after {
clear: both;
}
.l-left {
float: left;
}
.l-right {
float: right;
}
.ref-menu-fix{
text-align: center;
margin: 0 auto;
width: 50%;
font-size: 24px;
letter-spacing: 8px;
color: #fff !important;
margin-top:20px;
text-transform: uppercase;
}
.toggle-menu {
width: 50px;
height: 50px;
display: inline-block;
position: relative;
top: 20px;
}
.toggle-menu i {
position: absolute;
display: block;
height: 2px;
background: white;
width: 24px;
left: 10px;
-webkit-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
}
.toggle-menu i:nth-child(1) {
top: 16px;
}
.toggle-menu i:nth-child(2) {
top: 24px;
}
.toggle-menu i:nth-child(3) {
top: 32px;
}
Check this, i have fixed your issue..
function openNav() {
document.getElementById("myNav").style.left = "0";
setTimeout(function(){
document.getElementById("overlay-content").style.display = "flex";
// document.getElementById("menu-anim-fix").style.display = "flex";
}, 100);
}
function closeNav() {
document.getElementById("myNav").style.left = "-100%";
document.getElementById("overlay-content").style.display = "none";
}
header a {
letter-spacing: 8px;
text-transform: uppercase;
color: #fff;
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
-ms-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
transition: all 0.3s ease;
text-decoration:none !important;
}
header a:hover {
color: #d3a356;
letter-spacing: 10px;
}
.overlay45 {
height: 100%;
width: 100%;
position: fixed;
z-index: 49;
top: 0;
left: -100%;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0, 0.9);
overflow-x: hidden;
transition: 1s;
}
.overlay-content{
transition: 1s;
}
.overlay45 a {
display: block;
transition: 0.3s;
}
/*.overlay-content {
position: relative;
width: 100%;
}*/
.overlay45 .closebtn {
position: absolute;
top: -10px;
right: 65px;
font-size: 60px;
z-index: 50;
}
#media screen and (max-height: 450px) {
.overlay45 a {font-size: 20px}
.overlay45 .closebtn {
font-size: 40px;
top: 15px;
right: 35px;
}
}
#media screen and (max-width: 600px) {
.overlay45 .closebtn {
position: absolute;
top: -10px;
right: 20px;
font-size: 60px;
z-index: 50;
}
}
#media screen and (max-width: 767px) {
header .col-sm-12 {
text-align: center !important;
}
header .col-md-2 {
border-right: none !important;
border-left: none !important;
}
}
.refrences-website-fix{
padding-top: 10%;
}
.refrences-website-fix a{
font-size: 35px;
font-weight: 900;
}
.refrences-website-fix .corvin:hover
{
background-image: url(../img/logo.jpg);
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.header-top {
padding: 0 10px !important;
}
.header-top img{
width: 50px;
height: 50px;
}
#media screen and (max-width: 760px) {
.header-top img{
width: 80px;
height: 80px;
}
}
.header-top {
padding: 0 60px;
position: fixed;
top: 0;
width: 100%;
z-index: 16;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.header-top a{
/*color: grey !important;*/
}
.header-top i{
background: #fff !important;
}
h1 {
line-height: 70px;
height: 70px;
}
h1 a {
display: block;
padding: 0 10px;
}
.toggle-menu {
width: 50px;
height: 50px;
display: inline-block;
position: relative;
top: 20px;
}
.toggle-menu i {
position: absolute;
display: block;
height: 2px;
background: white;
width: 24px;
left: 10px;
-webkit-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
}
.toggle-menu i:nth-child(1) {
top: 16px;
}
.toggle-menu i:nth-child(2) {
top: 24px;
}
.toggle-menu i:nth-child(3) {
top: 32px;
}
/*.open-menu i:nth-child(1) {
top: 25px;
-webkit-transform: rotateZ(45deg);
-ms-transform: rotate(45deg);
transform: rotateZ(45deg);
}
.open-menu i:nth-child(2) {
background: transparent !important;
}
.open-menu i:nth-child(3) {
top: 25px;
-webkit-transform: rotateZ(-45deg);
-ms-transform: rotate(-45deg);
transform: rotateZ(-45deg);
}*/
nav {
height: 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
background:#000;
position: fixed;
width: 100%;
/* -webkit-transition: all 1s;
-o-transition: all 1s;
transition: all 1s;*/
visibility: hidden;
opacity: 0;
-webkit-transition: opacity 1s, visibility 0s 1s;
transition: opacity 1s, visibility 0s 1s;
z-index: 15;
}
.clearfix:before,
.clearfix:after {
content: "";
display: table;
}
.clearfix:after {
clear: both;
}
.l-left {
float: left;
}
.l-right {
float: right;
}
.ref-menu-fix{
text-align: center;
margin: 0 auto;
width: 50%;
font-size: 24px;
letter-spacing: 8px;
color: #fff !important;
margin-top:20px;
text-transform: uppercase;
}
.toggle-menu {
width: 50px;
height: 50px;
display: inline-block;
position: relative;
top: 20px;
}
.toggle-menu i {
position: absolute;
display: block;
height: 2px;
background: white;
width: 24px;
left: 10px;
-webkit-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
}
.toggle-menu i:nth-child(1) {
top: 16px;
}
.toggle-menu i:nth-child(2) {
top: 24px;
}
.toggle-menu i:nth-child(3) {
top: 32px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
</head>
<body style="background-color: #000;">
<header>
<div class="header-top clearfix">
<h1 class="l-left link"><img style="" src="assets/img/logo.jpg" height="100" width="100" alt=""></h1>
REFERENCES
<a class="l-right link toggle-menu" style="cursor:pointer;" onclick="openNav()" style="filter: brightness(1);" href="#">
<i ></i>
<i ></i>
<i ></i>
</a>
<!-- <span class="l-right link toggle-menu" style="font-size:30px;cursor:pointer" onclick="openNav()">☰ open</span> -->
</div>
<div id="myNav" class="overlay45">
<header style="background-color: #1f1f1f; height: 100%;">
×
<div class="row overlay-content" id="overlay-content" style="height: 100%; position: fixed;display: none;width: 100%;">
<div class="col-md-2" style="border-right: 1px solid #fff" ></div>
<div class="col-md-8">
<div class="row mt-5">
<div class="col-md-12" style="text-align: center;">
<img src="assets/img/logo2.png" style="width: 20%; margin: 1 auto;" alt="">
</div>
</div>
<div class="row mb-5">
<div class="col-sm-12 col-md-2"></div>
<div class="col-sm-12 col-md-4">
<a id="menu-anim-fix" href="index.html">Home Page</a>
</div>
<div class="col-sm-12 col-md-4" style="text-align: right;">
<a id="menu-anim-fix" href="ouroffer.html">Our Offer</a>
</div>
<div class="col-sm-12 col-md-2"></div>
</div>
<div class="row mb-5">
<div class="col-sm-12 col-md-2"></div>
<div class="col-sm-12 col-md-4">
<a id="menu-anim-fix" href="ourwork.html">Our Work</a>
</div>
<div class="col-sm-12 col-md-4" style="text-align: right;">
<a id="menu-anim-fix" href="stepform.html">Order Us</a>
</div>
<div class="col-sm-12 col-md-2"></div>
</div>
<div class="row mb-5">
<div class="col-sm-12 col-md-2"></div>
<div class="col-sm-12 col-md-4">
<a id="menu-anim-fix" href="website-art.html">Website Art</a>
</div>
<div class="col-sm-12 col-md-4" style="text-align: right;">
Contact Us
</div>
<div class="col-sm-12 col-md-2"></div>
</div>
<div class="row">
<div class="col-sm-12 col-md-12" style="text-align: center;">
<a id="menu-anim-fix" href="refrences.html">REFERENCES</a>
</div>
</div>
<div class="row mt-5">
<div class="col-md-12 mt-5" style="text-align: center;">
<p class="mt-5" style="color: #fff;font-size: 12px;">2019- All Rights Reserved</p>
</div>
</div>
</div>
<div class="col-md-2" style="border-left: 1px solid #fff" ></div>
</div>
</header>
</div>
</header>
</body>
</html>

Bootstrap - fit image to div

The size of image that fits into the div is 800 X 600 pixels. But some of the old images (portrait paintings) I have are 300 X 400 pixels. If I change the image size they will lose resolution. Instead, I would like to change div size. Is that possible? If not, is there a workaround?
I am providing code to be able to run the example as suggested
body {
background: #fff;
color: #666666;
font-family: "Open Sans", sans-serif;
}
a {
color: #18d26e;
transition: 0.5s;
}
a:hover, a:active, a:focus {
color: #18d36e;
outline: none;
text-decoration: none;
}
p {
padding: 0;
margin: 0 0 30px 0;
}
h1, h2, h3, h4, h5, h6 {
font-family: "Montserrat", sans-serif;
font-weight: 400;
margin: 0 0 20px 0;
padding: 0;
}
/* Back to top button */
.back-to-top {
position: fixed;
display: none;
background: #18d26e;
color: #fff;
display: inline-block;
width: 44px;
height: 44px;
text-align: center;
line-height: 1;
font-size: 16px;
border-radius: 50%;
right: 15px;
bottom: 15px;
transition: background 0.5s;
z-index: 11;
}
.back-to-top i {
padding-top: 12px;
color: #fff;
}
#media (max-width: 768px) {
.back-to-top {
bottom: 15px;
}
}
/*--------------------------------------------------------------
# Header
--------------------------------------------------------------*/
#header {
padding: 30px 0;
height: 92px;
position: fixed;
left: 0;
top: 0;
right: 0;
transition: all 0.5s;
z-index: 997;
}
#header.header-scrolled {
background: rgba(0, 0, 0, 0.9);
padding: 20px 0;
height: 72px;
transition: all 0.5s;
}
#header #logo {
float: left;
}
#media (min-width: 1024px) {
#header #logo {
padding-left: 60px;
}
}
#header #logo h1 {
font-size: 34px;
margin: 0;
padding: 0;
line-height: 1;
font-family: "Montserrat", sans-serif;
font-weight: 700;
letter-spacing: 3px;
}
#header #logo h1 a, #header #logo h1 a:hover {
color: #fff;
padding-left: 10px;
border-left: 4px solid #18d26e;
}
#header #logo img {
padding: 0;
margin: 0;
}
#media (max-width: 768px) {
#header #logo h1 {
font-size: 28px;
}
#header #logo img {
max-height: 40px;
}
}
img.scaled {
width: 100%;
}
/*--------------------------------------------------------------
# Navigation Menu
--------------------------------------------------------------*/
/* Nav Menu Essentials */
.nav-menu, .nav-menu * {
margin: 0;
padding: 0;
list-style: none;
}
.nav-menu ul {
position: absolute;
display: none;
top: 100%;
left: 0;
z-index: 99;
}
.nav-menu li {
position: relative;
white-space: nowrap;
}
.nav-menu > li {
float: left;
}
.nav-menu li:hover > ul,
.nav-menu li.sfHover > ul {
display: block;
}
.nav-menu ul ul {
top: 0;
left: 100%;
}
.nav-menu ul li {
min-width: 180px;
}
/* Nav Menu Arrows */
.sf-arrows .sf-with-ul {
padding-right: 30px;
}
.sf-arrows .sf-with-ul:after {
content: "\f107";
position: absolute;
right: 15px;
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
}
.sf-arrows ul .sf-with-ul:after {
content: "\f105";
}
/* Nav Meu Container */
#nav-menu-container {
float: right;
margin: 0;
}
#media (min-width: 1024px) {
#nav-menu-container {
padding-right: 60px;
}
}
#media (max-width: 768px) {
#nav-menu-container {
display: none;
}
}
/* Nav Meu Styling */
.nav-menu a {
padding: 0 8px 10px 8px;
text-decoration: none;
display: inline-block;
color: #fff;
font-family: "Montserrat", sans-serif;
font-weight: 700;
font-size: 13px;
text-transform: uppercase;
outline: none;
}
.nav-menu li:hover > a, .nav-menu > .menu-active > a {
color: #18d26e;
}
.nav-menu > li {
margin-left: 10px;
}
.nav-menu ul {
margin: 4px 0 0 0;
padding: 10px;
box-shadow: 0px 0px 30px rgba(127, 137, 161, 0.25);
background: #fff;
}
.nav-menu ul li {
transition: 0.3s;
}
.nav-menu ul li a {
padding: 10px;
color: #333;
transition: 0.3s;
display: block;
font-size: 13px;
text-transform: none;
}
.nav-menu ul li:hover > a {
color: #18d26e;
}
.nav-menu ul ul {
margin: 0;
}
/* Mobile Nav Toggle */
#mobile-nav-toggle {
position: fixed;
right: 0;
top: 0;
z-index: 999;
margin: 20px 20px 0 0;
border: 0;
background: none;
font-size: 24px;
display: none;
transition: all 0.4s;
outline: none;
cursor: pointer;
}
#mobile-nav-toggle i {
color: #fff;
}
#media (max-width: 768px) {
#mobile-nav-toggle {
display: inline;
}
}
/* Mobile Nav Styling */
#mobile-nav {
position: fixed;
top: 0;
padding-top: 18px;
bottom: 0;
z-index: 998;
background: rgba(0, 0, 0, 0.8);
left: -260px;
width: 260px;
overflow-y: auto;
transition: 0.4s;
}
#mobile-nav ul {
padding: 0;
margin: 0;
list-style: none;
}
#mobile-nav ul li {
position: relative;
}
#mobile-nav ul li a {
color: #fff;
font-size: 13px;
text-transform: uppercase;
overflow: hidden;
padding: 10px 22px 10px 15px;
position: relative;
text-decoration: none;
width: 100%;
display: block;
outline: none;
font-weight: 700;
font-family: "Montserrat", sans-serif;
}
#mobile-nav ul li a:hover {
color: #fff;
}
#mobile-nav ul li li {
padding-left: 30px;
}
#mobile-nav ul .menu-has-children i {
position: absolute;
right: 0;
z-index: 99;
padding: 15px;
cursor: pointer;
color: #fff;
}
#mobile-nav ul .menu-has-children i.fa-chevron-up {
color: #18d26e;
}
#mobile-nav ul .menu-has-children li a {
text-transform: none;
}
#mobile-nav ul .menu-item-active {
color: #18d26e;
}
#mobile-body-overly {
width: 100%;
height: 100%;
z-index: 997;
top: 0;
left: 0;
position: fixed;
background: rgba(0, 0, 0, 0.7);
display: none;
}
/* Mobile Nav body classes */
body.mobile-nav-active {
overflow: hidden;
}
body.mobile-nav-active #mobile-nav {
left: 0;
}
body.mobile-nav-active #mobile-nav-toggle {
color: #fff;
}
/*--------------------------------------------------------------
# Sections
--------------------------------------------------------------*/
/* Sections Header
--------------------------------*/
.section-header h3 {
font-size: 32px;
color: #111;
text-transform: uppercase;
text-align: center;
font-weight: 700;
position: relative;
padding-bottom: 15px;
}
.section-header h3::before {
content: '';
position: absolute;
display: block;
width: 120px;
height: 1px;
background: #ddd;
bottom: 1px;
left: calc(50% - 60px);
}
.section-header h3::after {
content: '';
position: absolute;
display: block;
width: 40px;
height: 3px;
background: #18d26e;
bottom: 0;
left: calc(50% - 20px);
}
.section-header p {
text-align: center;
padding-bottom: 30px;
color: #333;
}
/* Section with background
--------------------------------*/
.section-bg {
background: #f7f7f7;
}
/
/* Portfolio Section
--------------------------------*/
#portfolio {
padding: 60px 0;
}
#portfolio #portfolio-flters {
padding: 0;
margin: 5px 0 35px 0;
list-style: none;
text-align: center;
}
#portfolio #portfolio-flters li {
cursor: pointer;
margin: 15px 15px 15px 0;
display: inline-block;
padding: 10px 20px;
font-size: 12px;
line-height: 20px;
color: #666666;
border-radius: 4px;
text-transform: uppercase;
background: #fff;
margin-bottom: 5px;
transition: all 0.3s ease-in-out;
}
#portfolio #portfolio-flters li:hover, #portfolio #portfolio-flters li.filter-active {
background: #18d26e;
color: #fff;
}
#portfolio #portfolio-flters li:last-child {
margin-right: 0;
}
#portfolio .portfolio-wrap {
box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.08);
transition: 0.3s;
}
#portfolio .portfolio-wrap:hover {
box-shadow: 0px 4px 14px rgba(0, 0, 0, 0.16);
}
#portfolio .portfolio-item {
position: relative;
height: 360px;
overflow: hidden;
}
#portfolio .portfolio-item figure {
background: #000;
overflow: hidden;
height: 240px;
position: relative;
border-radius: 4px 4px 0 0;
margin: 0;
}
#portfolio .portfolio-item figure:hover img {
opacity: 0.4;
transition: 0.3s;
}
#portfolio .portfolio-item figure .link-preview, #portfolio .portfolio-item figure .link-details {
position: absolute;
display: inline-block;
visibility: hidden;
line-height: 1;
text-align: center;
width: 36px;
height: 36px;
background: #fff;
border-radius: 50%;
transition: 0.2s;
}
#portfolio .portfolio-item figure .link-preview i, #portfolio .portfolio-item figure .link-details i {
padding-top: 6px;
font-size: 22px;
color: #333;
}
#portfolio .portfolio-item figure .link-preview:hover, #portfolio .portfolio-item figure .link-details:hover {
background: #18d26e;
}
#portfolio .portfolio-item figure .link-preview:hover i, #portfolio .portfolio-item figure .link-details:hover i {
color: #fff;
}
#portfolio .portfolio-item figure .link-preview {
left: calc(50% - 38px);
top: calc(50% - 18px);
}
#portfolio .portfolio-item figure .link-details {
right: calc(50% - 38px);
top: calc(50% - 18px);
}
#portfolio .portfolio-item figure:hover .link-preview {
visibility: visible;
left: calc(50% - 44px);
}
#portfolio .portfolio-item figure:hover .link-details {
visibility: visible;
right: calc(50% - 44px);
}
#portfolio .portfolio-item .portfolio-info {
background: #fff;
text-align: center;
padding: 30px;
height: 90px;
border-radius: 0 0 3px 3px;
}
#portfolio .portfolio-item .portfolio-info h4 {
font-size: 18px;
line-height: 1px;
font-weight: 700;
margin-bottom: 18px;
padding-bottom: 0;
}
#portfolio .portfolio-item .portfolio-info h4 a {
color: #333;
}
#portfolio .portfolio-item .portfolio-info h4 a:hover {
color: #18d26e;
}
#portfolio .portfolio-item .portfolio-info p {
padding: 0;
margin: 0;
color: #b8b8b8;
font-weight: 500;
font-size: 14px;
text-transform: uppercase;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>TITLE</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="" name="keywords">
<meta content="" name="description">
<!-- Favicons -->
<link href="img/favicon.png" rel="icon">
<link href="img/apple-touch-icon.png" rel="apple-touch-icon">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i|Montserrat:300,400,500,700" rel="stylesheet">
<!-- Bootstrap CSS File -->
<link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Libraries CSS Files -->
<link href="lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="lib/animate/animate.min.css" rel="stylesheet">
<link href="lib/ionicons/css/ionicons.min.css" rel="stylesheet">
<link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<link href="lib/lightbox/css/lightbox.min.css" rel="stylesheet">
<!-- Main Stylesheet File -->
<link href="css/StyleSheet.css" rel="stylesheet">
</head>
<body>
<main id="main">
<section id="portfolio" class="section-bg">
<div class="container">
<header class="section-header">
<h3 class="section-title">Our Portfolio</h3>
</header>
<div class="row">
<div class="col-lg-12">
<ul id="portfolio-flters">
<li data-filter="*" class="filter-active">All</li>
<li data-filter=".filter-app">App</li>
<li data-filter=".filter-card">Card</li>
<li data-filter=".filter-web">Web</li>
</ul>
</div>
</div>
<div class="row portfolio-container">
<div class="col-lg-4 col-md-6 portfolio-item filter-app wow fadeInUp">
<div class="position-relative">
<figure>
<img src="img/portfolio/app1.jpg" class="img-fluid" alt="">
<i class="ion ion-eye scaled"></i>
<i class="ion ion-android-open align-self-lg-center scaled"></i>
<figcaption> figure caption...</figcaption>
</figure>
<div class="portfolio-info">
<h4>App 1</h4>
<p>App</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item filter-app wow fadeInUp" data-wow-delay="0.2s">
<div class="portfolio-wrap">
<figure>
<img src="img/portfolio/image2.jpg" class="img-fluid" alt="">
<i class="ion ion-eye"></i>
<i class="ion ion-android-open"></i>
</figure>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item filter-web wow fadeInUp" data-wow-delay="0.1s">
<div class="portfolio-wrap">
<figure>
<img src="img/portfolio/web3.jpg" class="img-fluid" alt="">
<i class="ion ion-eye"></i>
<i class="ion ion-android-open"></i>
</figure>
<div class="portfolio-info">
<h4>Web 3</h4>
<p>Web</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item filter-app wow fadeInUp" data-wow-delay="0.2s">
<div class="portfolio-wrap">
<figure>
<img src="img/portfolio/app2.jpg" class="img-fluid" alt="">
<i class="ion ion-eye"></i>
<i class="ion ion-android-open"></i>
</figure>
<div class="portfolio-info">
<h4>App 2</h4>
<p>App</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item filter-card wow fadeInUp">
<div class="portfolio-wrap">
<figure>
<img src="img/portfolio/card2.jpg" class="img-fluid" alt="">
<i class="ion ion-eye"></i>
<i class="ion ion-android-open"></i>
</figure>
<div class="portfolio-info">
<h4>Card 2</h4>
<p>Card</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item filter-web wow fadeInUp" data-wow-delay="0.1s">
<div class="portfolio-wrap">
<figure>
<img src="img/portfolio/web2.jpg" class="img-fluid" alt="">
<i class="ion ion-eye"></i>
<i class="ion ion-android-open"></i>
</figure>
<div class="portfolio-info">
<h4>Web 2</h4>
<p>Web</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item filter-app wow fadeInUp" data-wow-delay="0.2s">
<div class="portfolio-wrap">
<figure>
<img src="img/portfolio/app3.jpg" class="img-fluid" alt="">
<i class="ion ion-eye"></i>
<i class="ion ion-android-open"></i>
</figure>
<div class="portfolio-info">
<h4>App 3</h4>
<p>App</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item filter-card wow fadeInUp">
<div class="portfolio-wrap">
<figure>
<img src="img/portfolio/card1.jpg" class="img-fluid" alt="">
<i class="ion ion-eye"></i>
<i class="ion ion-android-open"></i>
</figure>
<div class="portfolio-info">
<h4>Card 1</h4>
<p>Card</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item filter-card wow fadeInUp" data-wow-delay="0.1s">
<div class="portfolio-wrap">
<figure>
<img src="img/portfolio/card3.jpg" class="img-fluid" alt="">
<i class="ion ion-eye"></i>
<i class="ion ion-android-open"></i>
</figure>
<div class="portfolio-info">
<h4>Card 3</h4>
<p>Card</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item filter-web wow fadeInUp" data-wow-delay="0.2s">
<div class="portfolio-wrap">
<figure>
<img src="img/portfolio/web1.jpg" class="img-fluid" alt="">
<i class="ion ion-eye"></i>
<i class="ion ion-android-open"></i>
</figure>
<div class="portfolio-info">
<h4>Web 1</h4>
<p>Web</p>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<i class="fa fa-chevron-up"></i>
<!-- JavaScript Libraries -->
<script src="lib/jquery/jquery.min.js"></script>
<script src="lib/jquery/jquery-migrate.min.js"></script>
<script src="lib/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="lib/easing/easing.min.js"></script>
<script src="lib/superfish/hoverIntent.js"></script>
<script src="lib/superfish/superfish.min.js"></script>
<script src="lib/wow/wow.min.js"></script>
<script src="lib/waypoints/waypoints.min.js"></script>
<script src="lib/counterup/counterup.min.js"></script>
<script src="lib/owlcarousel/owl.carousel.min.js"></script>
<script src="lib/isotope/isotope.pkgd.min.js"></script>
<script src="lib/lightbox/js/lightbox.min.js"></script>
<script src="lib/touchSwipe/jquery.touchSwipe.min.js"></script>
<!-- Contact Form JavaScript File -->
<script src="contactform/contactform.js"></script>
<!-- Template Main Javascript File -->
<script src="js/main.js"></script>
</body>
</html>

Extra space below the image

Note: The answers below are for the previous question regarding transition which I've edited for now.
I've got a blog-row with two columns. Each column has an inner which consists of an image on top and content related to the blog. I've taken an overlay pseudo-element for the image so when you hover on the inner the overlay should be applied on to the image with the transition. Everything works fine except the when you hover over the image you can see about 7px of space at the bottom of the image, to cover that I need to apply as margin-bottom: -7px. This is the problem with all the images on my page.
.row {
position: relative;
width: 100%;
margin-bottom: 40px;
}
.blog-item-inner {
background-color: #fbfbfb;
box-sizing: border-box;
transition: all 0.4s ease-in-out;
}
.blog-img-inner {
position: relative;
overflow: hidden;
text-align: center;
transition: all 0.4s ease-in-out;
}
img {
height: auto;
max-width: 100%;
margin-bottom: -7px;
}
.blog-post-date {
position: absolute;
top: 35px;
left: 35px;
border: 2px solid #ffffff;
text-align: center;
width: 40px;
height: 35px;
z-index: 999;
}
.blog-post-date p {
font-family: 'Open Sans', sans-serif;
font-size: 15px;
font-weight: 700;
color: #ffffff;
line-height: 1;
margin-top: 0px;
padding: 5px 10px;
}
.blog-post-date span {
font-family: 'Open Sans', sans-serif;
font-size: 8px;
color: #ffffff;
line-height: 1;
font-weight: 400;
margin-bottom: 0;
display: block;
margin-top: 3px;
}
.blog-title-excerpt {
padding: 40px 40px 30px;
}
.blog-title-excerpt h3 {
font-family: 'Open Sans', sans-serif;
font-size: 15px;
font-weight: 700;
color: #000000;
margin-top: 0;
margin-bottom: 15px;
}
.blog-title-excerpt p {
font-family: 'Open Sans', sans-serif;
font-size: 13px;
font-weight: 400;
color: #888888;
margin-bottom: 0;
}
.blog-image {
position: relative;
margin-bottom: 24px;
transition: box-shadow 0.3s linear;
}
.blog-img-inner:before {
content: " ";
z-index: 10;
opacity: 0;
position: absolute;
height: 100%;
top: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
transition: all 0.3s ease-in-out;
}
.blog-item-inner:hover .blog-img-inner:before {
opacity: 1;
}
.blog-image .post-meta {
position: absolute;
right: 12px;
bottom: 12px;
display: block;
z-index: 15;
}
.blog-content a {
color: #222222;
text-decoration: none;
font-family: "Droid Serif", sans-serif;
}
.post-meta {
display: block;
margin-top: 10px;
cursor: pointer;
}
.post-meta span {
margin-right: 10px;
font-size: 12px;
color: #c0c0c0;
transition: all 0.3s ease-in-out;
}
.post-meta span:hover {
color: #777777;
}
.col6 {
width: 47.96%;
}
.col {
display: inline-block;
float: left;
margin-right: 4%;
}
.col:last-child {
margin-right: 0;
}
<div class="row clearfix">
<div class="col col6 blog-items">
<div class="blog-item-inner clearfix">
<div class="blog-img-inner">
<img src="https://image.ibb.co/b8UnFw/blog1.jpg" alt="blog1">
<div class="blog-post-date">
<p>18 <span>DEC</span></p>
</div>
</div>
<div class="blog-title-excerpt">
<h5 class="fancy-heading-s1">ENDLESS ROAD STARTS</h5>
<p>No one rejects, dislikes, or avoids pleasure those who do not know a pulse</p>
<div class="post-meta">
<span><i class="fa fa-thumbs-o-up"></i> 183</span>
<span><i class="fa fa-comment-o"></i> 57</span>
</div>
</div>
</div>
</div>
<div class="col col6 blog-items">
<div class="blog-item-inner">
<div class="blog-img-inner">
<img src="https://image.ibb.co/b8UnFw/blog1.jpg" alt="blog6 Image">
<div class="blog-post-date">
<p>12 <span>JUN</span></p>
</div>
</div>
<div class="blog-title-excerpt">
<h5 class="fancy-heading-s1">ENDLESS ROAD STARTS</h5>
<p>No one rejects, dislikes, or avoids pleasure those who do not know a puIse</p>
<div class="post-meta">
<span><i class="fa fa-thumbs-o-up"></i> 120</span>
<span><i class="fa fa-comment-o"></i> 18</span>
</div>
</div>
</div>
</div>
</div>
The problem is that you forgot the "s" after 0.3 in your code.
transition: all 0.3s ease-in-out;
.row {
position: relative;
width: 100%;
margin-bottom: 40px;
}
.blog-item-inner {
background-color: #fbfbfb;
box-sizing: border-box;
transition: all 0.4s ease-in-out;
}
.blog-img-inner {
position: relative;
overflow: hidden;
text-align: center;
transition: all 0.4s ease-in-out;
}
.blog-post-date {
position: absolute;
top: 35px;
left: 35px;
border: 2px solid #ffffff;
text-align: center;
width: 40px;
height: 35px;
z-index: 999;
}
.blog-post-date p {
font-family: 'Open Sans', sans-serif;
font-size: 15px;
font-weight: 700;
color: #ffffff;
line-height: 1;
margin-top: 0px;
padding: 5px 10px;
}
.blog-post-date span {
font-family: 'Open Sans', sans-serif;
font-size: 8px;
color: #ffffff;
line-height: 1;
font-weight: 400;
margin-bottom: 0;
display: block;
margin-top: 3px;
}
.blog-title-excerpt {
padding: 40px 40px 30px;
}
.blog-title-excerpt h3 {
font-family: 'Open Sans', sans-serif;
font-size: 15px;
font-weight: 700;
color: #000000;
margin-top: 0;
margin-bottom: 15px;
}
.blog-title-excerpt p {
font-family: 'Open Sans', sans-serif;
font-size: 13px;
font-weight: 400;
color: #888888;
margin-bottom: 0;
}
.blog-image {
position: relative;
margin-bottom: 24px;
transition: box-shadow 0.3s linear;
}
.blog-img-inner:before {
content: " ";
z-index: 10;
opacity: 0;
position: absolute;
height: 100%;
top: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
transition: all 0.3s ease-in-out;
}
.blog-item-inner:hover .blog-img-inner:before {
opacity: 1;
}
.blog-image .post-meta {
position: absolute;
right: 12px;
bottom: 12px;
display: block;
z-index: 15;
}
.blog-content a {
color: #222222;
text-decoration: none;
font-family: "Droid Serif", sans-serif;
}
.post-meta {
display: block;
margin-top: 10px;
cursor: pointer;
}
.post-meta span {
margin-right: 10px;
font-size: 12px;
color: #c0c0c0;
transition: all 0.3s ease-in-out;
}
.post-meta span:hover {
color: #777777;
}
.col6 {
width: 47.96%;
}
.col {
display: inline-block;
float: left;
margin-right: 4%;
}
.col:last-child {
margin-right: 0;
}
<div class="row clearfix">
<div class="col col6 blog-items">
<div class="blog-item-inner clearfix">
<div class="blog-img-inner">
<img src="https://image.ibb.co/b8UnFw/blog1.jpg" alt="blog1">
<div class="blog-post-date">
<p>18 <span>DEC</span></p>
</div>
</div>
<div class="blog-title-excerpt">
<h5 class="fancy-heading-s1">ENDLESS ROAD STARTS</h5>
<p>No one rejects, dislikes, or avoids pleasure those who do not know a pulse</p>
<div class="post-meta">
<span><i class="fa fa-thumbs-o-up"></i> 183</span>
<span><i class="fa fa-comment-o"></i> 57</span>
</div>
</div>
</div>
</div>
<div class="col col6 blog-items">
<div class="blog-item-inner">
<div class="blog-img-inner">
<img src="https://image.ibb.co/b8UnFw/blog1.jpg" alt="blog6 Image">
<div class="blog-post-date">
<p>12 <span>JUN</span></p>
</div>
</div>
<div class="blog-title-excerpt">
<h5 class="fancy-heading-s1">ENDLESS ROAD STARTS</h5>
<p>No one rejects, dislikes, or avoids pleasure those who do not know a puIse</p>
<div class="post-meta">
<span><i class="fa fa-thumbs-o-up"></i> 120</span>
<span><i class="fa fa-comment-o"></i> 18</span>
</div>
</div>
</div>
</div>
</div>
Use simple transition: 0.4s ease;
.row {
position: relative;
width: 100%;
margin-bottom: 40px;
}
.blog-item-inner {
background-color: #fbfbfb;
box-sizing: border-box;
transition: all 0.4s ease-in-out;
}
.blog-img-inner {
position: relative;
overflow: hidden;
text-align: center;
transition: all 0.4s ease-in-out;
}
.blog-post-date {
position: absolute;
top: 35px;
left: 35px;
border: 2px solid #ffffff;
text-align: center;
width: 40px;
height: 35px;
z-index: 999;
}
.blog-post-date p {
font-family: 'Open Sans', sans-serif;
font-size: 15px;
font-weight: 700;
color: #ffffff;
line-height: 1;
margin-top: 0px;
padding: 5px 10px;
}
.blog-post-date span {
font-family: 'Open Sans', sans-serif;
font-size: 8px;
color: #ffffff;
line-height: 1;
font-weight: 400;
margin-bottom: 0;
display: block;
margin-top: 3px;
}
.blog-title-excerpt {
padding: 40px 40px 30px;
}
.blog-title-excerpt h3 {
font-family: 'Open Sans', sans-serif;
font-size: 15px;
font-weight: 700;
color: #000000;
margin-top: 0;
margin-bottom: 15px;
}
.blog-title-excerpt p {
font-family: 'Open Sans', sans-serif;
font-size: 13px;
font-weight: 400;
color: #888888;
margin-bottom: 0;
}
.blog-image {
position: relative;
margin-bottom: 24px;
transition: box-shadow 0.3s linear;
}
.blog-img-inner:before {
content: " ";
z-index: 10;
opacity: 0;
position: absolute;
height: 100%;
top: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
transition: 0.4s ease;
-webkit-transition: 0.4s ease;
-moz-transition: 0.4s ease;
-o-transition: 0.4s ease;
}
.blog-item-inner:hover .blog-img-inner:before {
opacity: 1;
}
.blog-image .post-meta {
position: absolute;
right: 12px;
bottom: 12px;
display: block;
z-index: 15;
}
.blog-content a {
color: #222222;
text-decoration: none;
font-family: "Droid Serif", sans-serif;
}
.post-meta {
display: block;
margin-top: 10px;
cursor: pointer;
}
.post-meta span {
margin-right: 10px;
font-size: 12px;
color: #c0c0c0;
transition: all 0.3s ease-in-out;
}
.post-meta span:hover {
color: #777777;
}
.col6 {
width: 47.96%;
}
.col {
display: inline-block;
float: left;
margin-right: 4%;
}
.col:last-child {
margin-right: 0;
}
<div class="row clearfix">
<div class="col col6 blog-items">
<div class="blog-item-inner clearfix">
<div class="blog-img-inner">
<img src="https://image.ibb.co/b8UnFw/blog1.jpg" alt="blog1">
<div class="blog-post-date">
<p>18 <span>DEC</span></p>
</div>
</div>
<div class="blog-title-excerpt">
<h5 class="fancy-heading-s1">ENDLESS ROAD STARTS</h5>
<p>No one rejects, dislikes, or avoids pleasure those who do not know a pulse</p>
<div class="post-meta">
<span><i class="fa fa-thumbs-o-up"></i> 183</span>
<span><i class="fa fa-comment-o"></i> 57</span>
</div>
</div>
</div>
</div>
<div class="col col6 blog-items">
<div class="blog-item-inner">
<div class="blog-img-inner">
<img src="https://image.ibb.co/b8UnFw/blog1.jpg" alt="blog6 Image">
<div class="blog-post-date">
<p>12 <span>JUN</span></p>
</div>
</div>
<div class="blog-title-excerpt">
<h5 class="fancy-heading-s1">ENDLESS ROAD STARTS</h5>
<p>No one rejects, dislikes, or avoids pleasure those who do not know a puIse</p>
<div class="post-meta">
<span><i class="fa fa-thumbs-o-up"></i> 120</span>
<span><i class="fa fa-comment-o"></i> 18</span>
</div>
</div>
</div>
</div>
</div>

when resizing the screen the button goes off the page

Everything is good except when the screen is resized the button goes off the screen. I have tried to fix this but I haven't been able to figure out how to resolve this. I have attached screen shots as well to get a better idea of what I'm talking about. Using HTML5 CSS3 and bootstrap
<section id="prod-one" class="prod-one">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="col-md-6 col-sm-6">
<div class="block wow fadeInRight" data-wow-delay=".3s" data-wow-duration="500ms">
<img src="images/cusotm%20image.jpg" alt="Custom">
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="block wow fadeInLeft" data-wow-delay=".3s" data-wow-duration="500ms">
<h3>test</h3>
<h2>test</h2>
<p class="par-one-ma">test</p>
<p>
test
</p>
<div class="area-fir"><a class="btn-max" href="#">Discover</a> </div>
</div>
</div>
</div>
</div>
</div>
</section>
CSS
#prod-one {
padding-top: 140px;
padding-bottom:;
}
#prod-oned .block {
padding: 20px 30px 30px;
}
#prod-one .block h2 {
font-size: 25px;
font-weight: 500;
margin-bottom: 30px;
text-transform: none;
color: #00bfff;
}
#prod-one.block h3 {
font-size: 40px;
font-weight: 400;
margin-bottom: 30px;
text-transform: uppercase;
}
#prod-one.block p {
color: #727272;
font-size: 16px;
line-height: 28px;
margin-bottom: 35px;
}
#prod-one .block img {
max-width: 100%;
padding-top: 25px;
}
#prod-one .block .matrix-bold {
font-weight: 500;
margin-top: -20px;
}
.btn-max {
width: auto;
margin-right: auto;
padding: 2% 50%;
font-weight: 500;
text-decoration: none;
background-color: #fff;
color: #00bfff;
transition: background-color 0.2s, border 0.2s, color 0.2s;
border: 2px solid #00bfff;
letter-spacing: .5px;
font-size: 18px;
}
.btn-max:hover,
.btn-max:active {
border: 2px solid #00bfff;
background-color: #00bfff;
color: #1c1c1c;
}
#prod-one {
padding-top: 140px;
padding-bottom:;
}
#prod-oned .block {
padding: 20px 30px 30px;
}
#prod-one .block h2 {
font-size: 25px;
font-weight: 500;
margin-bottom: 30px;
text-transform: none;
color: #00bfff;
}
#prod-one.block h3 {
font-size: 40px;
font-weight: 400;
margin-bottom: 30px;
text-transform: uppercase;
}
#prod-one.block p {
color: #727272;
font-size: 16px;
line-height: 28px;
margin-bottom: 35px;
}
#prod-one .block img {
max-width: 100%;
padding-top: 25px;
}
#prod-one .block .matrix-bold {
font-weight: 500;
margin-top: -20px;
}
.btn-max {
width: auto;
margin-right: auto;
padding: 2% 44%;
font-weight: 500;
text-decoration: none;
background-color: #fff;
color: #00bfff;
transition: background-color 0.2s, border 0.2s, color 0.2s;
border: 2px solid #00bfff;
letter-spacing: .5px;
font-size: 18px;
}
.btn-max:hover,
.btn-max:active {
border: 2px solid #00bfff;
background-color: #00bfff;
color: #1c1c1c;
}
<section id="prod-one" class="prod-one">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="col-md-6 col-sm-6">
<div class="block wow fadeInRight" data-wow-delay=".3s" data-wow-duration="500ms">
<img src="images/cusotm%20image.jpg" alt="Custom">
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="block wow fadeInLeft" data-wow-delay=".3s" data-wow-duration="500ms">
<h3>test</h3>
<h2>test</h2>
<p class="par-one-ma">test</p>
<p>
test
</p>
<div class="area-fir"><a class="btn-max" href="#">Discover</a> </div>
</div>
</div>
</div>
</div>
</div>
</section>
Update your css [padding: 2% 45%;] as follows works perfectly:-
.btn-max {
font-weight: 500;
text-decoration: none;
background-color: #FFF;
color: #00BFFF;
transition: background-color 0.2s ease 0s, border 0.2s ease 0s, color 0.2s ease 0s;
border: 2px solid #00BFFF;
letter-spacing: 0.5px;
font-size: 18px;
width: 21%;
padding: 2% 45%;
}