Back to buttons

Live preview

Preview settings

Changes appear as you type. Use Tab to test keyboard focus.

⌘ / Ctrl + S saves locally

Anmol-Baranwal

HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.

By @Anmol-Baranwal

Remix button

Button submission checks

Checks will appear after the preview updates.

Buttons only: no full pages, forms, cards or navigation. Put scripts in the JavaScript tab. Tailwind uses utilities from HTML and JavaScript; use complete class names. Custom CSS supports plain CSS, without @apply, imports or plugins.

Accessibility quick check

Waiting for the rendered preview…

Try Tab, Enter and Space in the preview. Check the focus ring, hover and disabled states, then enable Reduce motion. These checks are guidance, not an accessibility certification.

Explore freely here. Remix to publish your version with credit to the creator.

About Anmol-Baranwal

Anmol-Baranwal is an animated CSS button by @Anmol-Baranwal. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.

Effects and categories
Hover effects
Using this example
Copy the HTML or download index.html, style.css and app.js. Test keyboard focus, motion and contrast in your own project.

Usage, Tailwind and licensing questions

Read the source files

HTML

<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta
      name="description"
      content="Website showcasing the button designed by Anmol Baranwal."
    />
    <meta name="keywords" content="Anmol Baranwal, CSS3, Button" />
    <meta name="author" content="Anmol Baranwal" />

    <!-- css stylesheet -->
    <link rel="stylesheet" href="style.css" />

    <title>Anmol-Baranwal</title>
  </head>
  <body>
    <div class="btn-wrapper">
      <div class="btn-item btn-effect">Anmol Baranwal</div>
    </div>
  </body>
</html>

CSS


:root {
  /* --main-color: #a8a9b4; */
  --transition-speed2: 0.2s;
  --transition-speed4: 0.4s;
  --main-color: #0a1931;
  --hover-color: #ff7e28;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-wrapper .btn-item {
  position: relative;
  width: 240px;
  font-size: 24px;
  text-align: center;
  padding: 8px 0px;
}

.btn-wrapper .btn-item:hover {
  color: var(--hover-color);
}

.btn-effect {
  border: 1px solid transparent;
  -webkit-transition: all var(--transition-speed4) cubic-bezier(0.5, 0.24, 0, 1);
  transition: all var(--transition-speed4) cubic-bezier(0.5, 0.24, 0, 1);
}

.btn-effect::before {
  content: "";
  position: absolute;
  left: 0px;
  bottom: 0px;
  z-index: -1;
  width: 0%;
  height: 1px;
  background: var(--hover-color);
  box-shadow: inset 0px 0px 0px var(--main-color);
  display: block;
  -webkit-transition: all var(--transition-speed4) cubic-bezier(0.5, 0.24, 0, 1);
  transition: all var(--transition-speed4) cubic-bezier(0.5, 0.24, 0, 1);
}

.btn-effect:hover::before {
  width: 100%;
}

.btn-effect::after {
  content: "";
  position: absolute;
  right: 0px;
  top: 0px;
  z-index: -1;
  width: 0%;
  height: 1px;
  background: var(--hover-color);
  -webkit-transition: all var(--transition-speed4) cubic-bezier(0.5, 0.24, 0, 1);
  transition: all 0.4s cubic-bezier(0.5, 0.24, 0, 1);
}
.btn-effect:hover::after {
  width: 100%;
}

.btn-effect:hover {
  border-left: 1px solid var(--hover-color);
  border-right: 1px solid var(--hover-color);
}