Back to buttons

Live preview

Preview settings

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

⌘ / Ctrl + S saves locally

Sudhanshu-Sharma-22's button

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

By @Sudhanshu-Sharma-22

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 Sudhanshu-Sharma-22's button

Sudhanshu-Sharma-22's button is an animated CSS button by @Sudhanshu-Sharma-22. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.

Effects and categories
Hover effects, Social
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

<div class="help">
  
  <div class="question">?</div>

  <div class="popup">
    <h3>What does my level mean?</h3>
    <p>In IT you develop lots of <strong>skills</strong> using a wide range of <strong>software</strong>.</p>
    <p>Your level tells you <strong>how good your skills are</strong> and <strong>how well you can apply them</strong> to produce a product that <strong>meets a brief</strong> or <strong>solves a problem</strong>.</p>
    <p>Units are assessed by either an <strong>end of unit test</strong>, a <strong>final piece of work</strong> or by judging your <strong>overall progress</strong> in the unit.</p><br><br>
    <div class="tell-me">
      <p>Tell me more!</p>
      <div class="popup2">
        <h4>Sub-levels</h4>
        <p class="sub-levels"><strong>a</strong> = you consistently reach this level</p>
        <p class="sub-levels"><strong>b</strong> = you reach this level most of the time</p>
        <p class="sub-levels"><strong>c</strong> = you sometimes reach this level</p>
        <p><a href="https://github.com/Sudhanshu-Sharma-22" target="_blank">Click here</a> to follow me on github.</p>
      </div>
    </div>
  </div>

</div>

CSS


body {
  padding: 300px;
  font-family: ubuntu;
}

.help {
  width: 40px;
  margin: 0 auto;
}

.help .question {
  height: 40px;
  width: 40px;
  background: #ccc;
  font-size: 32px;
  line-height: 40px;
  text-align: center;
  border-radius: 50%;
  cursor: pointer;
}

.help .popup, .help .popup2 {
  width: 560px;
  height: 0px;
  text-align: left;
  overflow: hidden;
  position: relative;
  background: #eee;
  opacity: 0;
  transition: 1s;
}

.help .popup {
  left: -260px;
  top: 10px;
}

.help .popup2 {
  height: 220px;
}

.help .popup2 h4 {
  font-size: 18px;
  padding: 10px;
  margin: 0;
}

.help:hover .popup {
  opacity: 1;
  height: 270px;
}

.help .tell-me p:first-child {
  color: #317eac;
  cursor: pointer;
}

.tell-me {
  width: 150px;
}

.help .tell-me:hover .popup2 {
  top: -220px;
  opacity: 1;
}

.help .popup h3 {
  margin: 0;
  padding: 10px 0 0 10px;
  height: 30px;
  background: #555;
  color: #fff;
  font-weight: 400;
  font-size: 18px;
}

.help .popup p {
  font-size: 16px;
  padding: 10px;
  margin: 0;
}

.help .popup .popup2 .sub-levels {
  padding: 0 0 10px 140px;
}

.help .popup .popup2 .sub-levels strong {
  font-size: 20px;
}

.help .popup .popup2 p:nth-child(5) {
  padding: 20px 0 0 10px;
}

.help .popup a {
  text-decoration: none;
  color: #317eac;
}

.help .popup a:visited {
  color: #317eac;
}

.help .popup p em {
  font-size: 12px;
}

JavaScript

// Add Your button script here