I'm looking to enhance a logo image within a header element by expanding it on hover or creating a pulse effect. I thought of increasing the max-width and adding a transition for simplicity. However, my main concern is how to make only the img element expand, not the entire header. Any suggestions on achieving this? Code snippet provided below.
If it matters, I am using Bootstrap 4.
* {
box-sizing: border-box;
}
body {
/*background-color: #393939*/
background: url("../Images/background.jpg") repeat;
}
/*=-=-= NAVIGATION BAR =-=-*/
#header-nav {
background-color: #262626;
font-family: 'Kanit', sans-serif;
font-size: 1.1em;
text-transform: uppercase;
}
.grid-container {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
}
.grid-container > a {
text-align: center;
}
.navlink {
display: inline-block;
color: #C9C9C9;
padding: 10px;
padding-bottom: 10px;
background:
linear-gradient(white, white)
bottom
/100% 0px
no-repeat;
transition: 0.2s all;
}
.navlink:hover {
color: #FFF;
text-decoration: none;
background-size: 100% 4px;
}
.active {
color: #FFF;
}
/*=-=-= HEADING BANNER =-=-*/
header {
background: url("https://i.imgur.com/CYyE6bN.png") center;
border-bottom: thick solid #461F66;
}
.heading-banner {
max-width: 75%;
padding: 5%;
filter: drop-shadow(8px 8px 20px #000);
}
.heading-banner:hover {
max-width: 80%;
}
<!DOCTYPE html>
<html>
<head>
<!-- Meta & Other -->
<title>Infamous | Home</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="Infamous official website">
<meta name="keywords" content ="Infamous, Minecraft, Server, Game, Gaming">
<meta name="author" content="MrWardy">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<link rel="stylesheet" href="./Stylesheets/default.css">
<!-- Fonts -->
<script src="https://kit.fontawesome.com/35fad75205.js" crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/css2?family=Kanit&display=swap" rel="stylesheet">
</head>
<body>
<header>
<nav id="header-nav" class="navbar-nav">
<div class="container grid-container">
<a class="active navlink" href="#"><i class="fas fa-home"></i> Home</a>
<a class="navlink" href="#rules"><i class="fas fa-book"></i> Rules</a>
<a class="navlink" href="#vote"><i class="fas fa-star"></i> Vote</a>
<a class="navlink" href="#store"><i class="fas fa-tags"></i> Store</a>
<a class="navlink" href="https://discord.gg/ZnN3f4P" target="_blank"><i class="fab fa-discord"></i> Discord</a>
<a class="navlink" href="https://www.youtube.com/channel/UCFvs3IZNgziCe0WARpJpYVw" target="_blank"><i class="fab fa-youtube"></i> YouTube</a>
</div>
</nav>
<!--
<div id="heading">
<img class="img-fluid" src="./Images/rome.png" alt="Minecraft Screenshot">
</div>
-->
<img class="heading-banner mx-auto d-block" src="https://i.imgur.com/0h5g3bd.png" alt="Infamous banner">
</header>
<!-- JavsScript -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e18c83858f9aa9848686709e82878db98180829094768284078881">[email protected]</a>/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
</body>
</html>