10 Modern Logo Hover Effects with HTML and CSS

Faraz

By Faraz -

Explore 10 stylish hover effects for logos using HTML and CSS. Learn how to implement rotate, scale, skew, flip, grayscale, blur, brightness, shake, translate, and pulse effects.


10-modern-logo-hover-effects-with-html-and-css.webp

Table of Contents

  1. Project Introduction
  2. HTML Code
  3. CSS Code
  4. Conclusion
  5. Preview

In the world of web design, adding unique hover effects to logos can enhance the user experience and make your site stand out. Hover effects bring interactivity and visual appeal to your designs, making them more engaging. In this blog, we’ll explore ten modern and eye-catching hover effects for logos using simple HTML and CSS. Each effect will be showcased with step-by-step instructions.

  1. Rotate: The Rotate effect makes your logo spin around its center when hovered over. This effect adds a playful touch to your site’s design.
  2. Scale Up: The Scale-up effect enlarges your logo slightly, making it more prominent when a user hovers over it. This effect is great for drawing attention.
  3. Skew: The Skew effect tilts your logo on the X-axis, giving it a dynamic and modern look when hovered over.
  4. Flip: The Flip effect flips your logo horizontally, creating a fun and engaging visual change on hover.
  5. Grayscale: The Grayscale effect removes color from your logo, turning it into shades of gray. This effect can create a sleek and professional look.
  6. Blur: The Blur effect adds a soft blur to your logo on hover, giving it a dreamy and sophisticated appearance.
  7. Brightness: The Brightness effect increases the brightness of your logo on hover, making it stand out with a more vivid look.
  8. Shake: The Shake effect creates a slight shaking motion for your logo, adding a playful and energetic touch on hover.
  9. Translate: The Translate effect moves your logo upwards on hover, creating a subtle but noticeable movement.
  10. Pulse: The Pulse effect makes your logo gently grow and shrink in size, creating a pulsing effect that draws attention.

Source Code

Step 1 (HTML Code):

The first thing we need to do is create our HTML File. We'll start with well-organized markup. After creating the files just paste the following codes into your file. Remember that you must save a file with the .html extension.

Here’s a breakdown of the structure and functionality:

1. Document Type and Language:

<!DOCTYPE html>
<html lang="en">
  • Specifies that this is an HTML5 document and the language used is English.

2. Head Section:

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Logo Hover Effects</title>
    <link rel="stylesheet" href="styles.css">
</head>
  • <meta charset="UTF-8">: Sets the character encoding to UTF-8 for supporting a wide range of characters.
  • <meta name="viewport" content="width=device-width, initial-scale=1.0">: Ensures the page is responsive, adjusting to different screen sizes.
  • <title>Logo Hover Effects</title>: Sets the title of the webpage that appears in the browser tab.
  • <link rel="stylesheet" href="styles.css">: Links to an external CSS file named styles.css for styling the page.

3. Body Section:

<body>
    <div class="effects-container">
        ...
    </div>
</body>
  • The body contains a div with the class effects-container that houses various logo effects.

4. Effects Container:

<div class="effects-container">
    ...
</div>
  • This div acts as a wrapper for all the effect examples.

5. Effect Wrappers: Each effect is contained in a div with the class effect-wrapper. Inside each wrapper:

<div class="effect-wrapper">
    <p class="effect-name">Effect Name</p>
    <div class="effect-box effectX">
        <img src="image_url" alt="Effect X">
    </div>
</div>
  • <p class="effect-name">Effect Name</p>: Displays the name of the effect.
  • <div class="effect-box effectX">: This div contains the logo image and applies a specific CSS class (like effect1, effect2, etc.) to demonstrate different hover effects.
  • <img src="https://www.codewithfaraz.com/favicon.ico" alt="Effect X">: Displays a favicon image for each effect. The alt attribute provides alternative text for the image.

Step 2 (CSS Code):

Once the basic HTML structure of the logo is in place, the next step is to add styling to the logo using CSS. Here’s a detailed explanation of each section:

Body Styling

body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  background-color: #f5f5f5;
  font-family: Arial, sans-serif;
}
  • display: flex;: Uses Flexbox layout to center content.
  • justify-content: center;: Horizontally centers content within the body.
  • align-items: center;: Vertically centers content within the body.
  • height: 100vh;: Makes the body take up the full height of the viewport.
  • margin: 0;: Removes default margin.
  • background-color: #f5f5f5;: Sets a light gray background color.
  • font-family: Arial, sans-serif;: Uses Arial font or a similar sans-serif font.

Effects Container

.effects-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}
  • display: flex;: Uses Flexbox to layout children.
  • flex-wrap: wrap;: Allows child elements to wrap onto multiple lines.
  • justify-content: center;: Centers child elements horizontally.
  • gap: 20px;: Adds a 20-pixel gap between child elements.

Effect Wrapper

.effect-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}
  • display: flex;: Uses Flexbox for layout.
  • flex-direction: column;: Arranges children in a vertical column.
  • align-items: center;: Centers children horizontally within the wrapper.

Effect Name

.effect-name {
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: bold;
  color: #333;
}
  • margin-bottom: 10px;: Adds a 10-pixel space below the element.
  • font-size: 16px;: Sets the font size to 16 pixels.
  • font-weight: bold;: Makes the text bold.
  • color: #333;: Sets the text color to a dark gray.

Effect Box

.effect-box {
  width: 100px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 10px;
  background-color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
  • width: 100px; and height: 100px;: Sets dimensions for the box.
  • display: flex;: Uses Flexbox for centering contents.
  • justify-content: center; and align-items: center;: Centers the image inside the box.
  • overflow: hidden;: Hides any content that overflows the box.
  • border-radius: 10px;: Rounds the corners of the box.
  • background-color: #fff;: Sets the background color to white.
  • box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);: Adds a subtle shadow for a 3D effect.
  • transition: transform 0.3s ease, box-shadow 0.3s ease;: Smoothly animates changes to transform and box-shadow properties.

Effect Box Image

.effect-box img {
  width: 80px;
  height: 80px;
  transition: transform 0.3s ease, filter 0.3s ease;
}
  • width: 80px; and height: 80px;: Sets dimensions for the image inside the box.
  • transition: transform 0.3s ease, filter 0.3s ease;: Smoothly animates changes to transform and filter properties.

Hover Effects on Effect Box

.effect-box:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
  • transform: scale(1.1);: Scales up the box to 110% of its size on hover.
  • box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);: Increases the shadow for a more pronounced effect on hover.

Specific Hover Effects

Each effect class (effect1, effect2, etc.) targets different hover animations:

  • effect1:hover img { transform: rotate(360deg); }: Rotates the image 360 degrees.
  • effect2:hover img { transform: scale(1.5); }: Scales the image up to 150%.
  • effect3:hover img { transform: skewX(20deg); }: Skews the image along the X-axis.
  • effect4:hover img { transform: scaleX(-1); }: Flips the image horizontally.
  • effect5:hover img { filter: grayscale(100%); }: Applies a 100% grayscale filter.
  • effect6:hover img { filter: blur(3px); }: Applies a 3-pixel blur filter.
  • effect7:hover img { filter: brightness(150%); }: Increases brightness by 150%.
  • effect8:hover img { animation: shake 0.5s ease-in-out; }: Triggers a shake animation.
  • effect9:hover img { transform: translateY(-20px); }: Moves the image up by 20 pixels.
  • effect10:hover img { animation: pulse 1s infinite; }: Triggers a pulse animation that repeats indefinitely.

Keyframes for Animations

  • @keyframes shake: Defines a shaking animation by moving the image horizontally.
  • @keyframes pulse: Defines a pulsing animation by scaling the image up and down.
body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  background-color: #f5f5f5;
  font-family: Arial, sans-serif;
}

.effects-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.effect-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.effect-name {
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

.effect-box {
  width: 100px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 10px;
  background-color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.effect-box img {
  width: 80px;
  height: 80px;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.effect-box:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.effect1:hover img {
  transform: rotate(360deg);
}

.effect2:hover img {
  transform: scale(1.5);
}

.effect3:hover img {
  transform: skewX(20deg);
}

.effect4:hover img {
  transform: scaleX(-1);
}

.effect5:hover img {
  filter: grayscale(100%);
}

.effect6:hover img {
  filter: blur(3px);
}

.effect7:hover img {
  filter: brightness(150%);
}

.effect8:hover img {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  50% { transform: translateX(10px); }
  75% { transform: translateX(-10px); }
  100% { transform: translateX(0); }
}

.effect9:hover img {
  transform: translateY(-20px);
}

.effect10:hover img {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
      transform: scale(1);
  }
  50% {
      transform: scale(1.2);
  }
  100% {
      transform: scale(1);
  }
} 

Final Output:

10-modern-logo-hover-effects-with-html-and-css.gif

Conclusion:

These ten modern hover effects can add a unique flair to your logo and enhance the overall user experience on your website. By implementing these effects with simple HTML and CSS, you can create a more interactive and visually appealing design. Experiment with these effects and find the perfect combination that matches your website's style and branding.

Feel free to customize the effects and adjust the parameters to suit your needs.

That’s a wrap!

I hope you enjoyed this post. Now, with these examples, you can create your own amazing page.

Did you like it? Let me know in the comments below 🔥 and you can support me by buying me a coffee

And don’t forget to sign up to our email newsletter so you can get useful content like this sent right to your inbox!

Thanks!
Faraz 😊

End of the article

Subscribe to my Newsletter

Get the latest posts delivered right to your inbox


Latest Post

Please allow ads on our site🥺