Close Menu

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    How to create Order Button Animation using HTML CSS and JS

    22 September 2025

    How to make Pixel Bat Animation using HTML & CSS

    20 September 2025

    How to make Magic Animated Motion Button using HTML & CSS

    15 September 2025
    Facebook X (Twitter) Instagram YouTube Telegram Threads
    Coding StellaCoding Stella
    • Home
    • Blog
    • HTML & CSS
      • Login Form
    • JavaScript
    • Hire us!
    Coding StellaCoding Stella
    Home - JavaScript - How to create Netflix Button Animation using HTML CSS and JS
    JavaScript

    How to create Netflix Button Animation using HTML CSS and JS

    Coding StellaBy Coding Stella2 September 2025No Comments4 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Email WhatsApp Copy Link

    Let’s create a Netflix Button Animation using HTML, CSS, and JavaScript.
    This project will replicate the bold, cinematic feel of Netflix with an animated button that responds dynamically to hover and click events.

    We’ll use:

    • HTML for the button structure.
    • CSS for styling, glowing effects, and smooth hover transitions.
    • JavaScript to trigger animations like a play pulse or ripple effect.

    This project is great for learning how to combine front-end technologies to build interactive and visually striking UI components. Whether you’re practicing for fun or adding effects to a website, the Netflix Button Animation will make your design look powerful and engaging. 🍿🔥

    HTML :

    This code creates a simple webpage with a button styled as “Netflix.” The HTML defines a container holding a link (<a>) with the class btn, which will be styled using style.css to look and animate like a Netflix button, while script.js can add interactivity. The <head> section sets the page title and ensures it works well on all devices, and the <body> displays the button in the center.

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Netflix Button Animation | @coding.stella</title>
        <link rel="stylesheet" href="./style.css">
    </head>
    <body>
    
     <div class="container">
       <a href="#" class="btn">Netflix</a>
     </div>
    
     <script src="script.js"></script>
    
    </body>
    </html>

    CSS :

    This CSS styles the Netflix button with a modern animated effect: it centers the button on a dark background, gives it a red Netflix-themed color, and makes it glow with a red shadow when hovered. The span elements (which act as animated lines) are hidden by default (scaleY(0)) but expand vertically on hover, creating a cool animated border effect. The smooth transitions, hover glow, and letter spacing change make the button look dynamic and eye-catching.

    @import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&family=Nunito:ital,wght@0,200..1000;1,200..1000&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
    
    * {
      margin: 0px;
      padding: 0px;
      box-sizing: border-box;
    }
    
    body {
      font-family: "Poppins", serif;
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
      background: #252432;
      overflow: hidden;
    }
    
    .btn {
      position: relative;
      width: 240px;
      height: 80px;
      display: flex;
      justify-content: center;
      align-items: center;
      background: rgba(0, 0, 0, 0.2);
      border-radius: 10px;
      cursor: pointer;
      overflow: hidden;
      font-size: 2em;
      transition: 0.5s;
      text-decoration: none;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #e50914;
      /* border: 1px solid #fff; */
    }
    
    .btn:hover {
      filter: drop-shadow(0 0 10px #e50914) drop-shadow(0 0 30px #e50914);
      letter-spacing: 0.2em;
      color: #fff;
    }
    
    .btn span {
      position: absolute;
      top: 0;
      width: 2px;
      height: 100%;
      background: #e50914;
      pointer-events: none;
      transition: transform 0.2s ease-in-out;
      z-index: -1;
      transform: scaleY(0);
      transform-origin: bottom;
    }
    
    .btn:hover span {
      transform: scaleY(1);
      transform-origin: top;
    }
    
    .btn span:nth-child(even) {
      transform-origin: top;
    }
    
    .btn:hover span:nth-child(even) {
      transform-origin: bottom;
    }
    

    JavaScript:

    This JavaScript waits until the page loads, then finds all elements with the class .btn and adds 120 <span> lines inside each button. Each span is positioned slightly to the right (left: i*2px) to cover the button and is given a random transition delay, so when the button is hovered, the red line animation plays at slightly different times, creating a glowing, wavy Netflix-style animation effect.

    document.addEventListener("DOMContentLoaded", function () {
      let btns = document.querySelectorAll(".btn");
      btns.forEach(function (btn) {
        let spans = [];
        for (let i = 0; i < 120; i++) {
          let span = document.createElement("span");
          span.style.left = `${i * 2}px`;
          spans.push(span);
          btn.appendChild(span);
          let randomDealy = Math.random() * 1 + 0;
          span.style.transitionDelay = randomDealy + "s";
        }
      });
    });

    In conclusion, building a Netflix Button Animation with HTML, CSS, and JavaScript is a fun way to experiment with creative UI effects. It gives your project a cinematic vibe while teaching you hover transitions, animation timing, and event-driven effects. Keep pushing your creativity and your buttons will never feel boring again! 🚀

    If your project has problems, don’t worry. Just click to download the source code and face your coding challenges with excitement. Have fun coding!

    Button netflix
    Share. Copy Link Twitter Facebook LinkedIn Email WhatsApp
    Previous ArticleHow to create Animated Tesla Landing Page using HTML CSS and JS
    Next Article How to create Blossoming Flower Animation using HTML CSS and JS
    Coding Stella
    • Website

    Related Posts

    JavaScript

    How to create Order Button Animation using HTML CSS and JS

    22 September 2025
    JavaScript

    How to make Animated Slider with Button Wave Effect using HTML CSS & JavaScript

    13 September 2025
    JavaScript

    How to create Blossoming Flower Animation using HTML CSS and JS

    4 September 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Trending Post

    Master Frontend in 100 Days Ebook

    2 March 202428K Views

    How to make Modern Login Form using HTML & CSS | Glassmorphism

    11 January 202425K Views

    How to make I love you Animation in HTML CSS & JavaScript

    14 February 202420K Views

    How to make Valentine’s Day Card using HTML & CSS

    13 February 202414K Views
    Follow Us
    • Instagram
    • Facebook
    • YouTube
    • Twitter
    ads
    Featured Post

    How to Create A Dark/Light Calendar in HTML CSS & JavaScript

    11 December 2023

    How to Create Glowing Cards on Hover in HTML CSS & JavaScript

    3 January 2024

    How to make Glowing Tube Loader using HTML & CSS

    2 October 2024

    How to create Animated Credit Card using HTML CSS and JS

    9 August 2025
    Latest Post

    How to create Order Button Animation using HTML CSS and JS

    22 September 2025

    How to make Pixel Bat Animation using HTML & CSS

    20 September 2025

    How to make Magic Animated Motion Button using HTML & CSS

    15 September 2025

    How to make Animated Slider with Button Wave Effect using HTML CSS & JavaScript

    13 September 2025
    Facebook X (Twitter) Instagram YouTube
    • About Us
    • Privacy Policy
    • Return and Refund Policy
    • Terms and Conditions
    • Contact Us
    • Buy me a coffee
    © 2025 Coding Stella. Made with 💙 by @coding.stella

    Type above and press Enter to search. Press Esc to cancel.

    Ad Blocker Enabled!
    Ad Blocker Enabled!
    Looks like you're using an ad blocker. We rely on advertising to help fund our site.
    Okay! I understood