Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <body>
  <div class="container">
    <div class="top">
      <h1>Plans & Pricing</h1>
      <div class="toggle-btn">
        <span style="margin: 0.8em;">Annually</span>
        <label class="switch">
          <input type="checkbox" id="checbox" onclick="check()" ; />
          <span class="slider round"></span>
        </label>
        <span style="margin: 0.8em;">Monthly</span></div>
    </div>

    <div class="package-container">
      <div class="packages">
        <h1>Basic</h1>
        <h2 class="text1">&dollar;9.99</h2>
        <h2 class="text2">&dollar;119.99</h2>
        <ul class="list">
          <li class="first">2000 Subscribers</li>
          <li>12,000 Emails/month</li>
          <li>Multi-User Accounts</li>
          <li>Email Support</li>
        </ul>
        <a href="#" class="button button1">Start Now</a>
      </div>
      <div class="packages">
        <h1>Professional</h1>
        <h2 class="text1">&dollar;19.99</h2>
        <h2 class="text2">&dollar;239.99</h2>
        <ul class="list">
          <li class="first">Basic +</li>
          <li>Landing Pages</li>
          <li>Pop-up Forms</li>
          <li>Premium Support</li>
        </ul>
        <a href="#" class="button button2">Start Now</a>
      </div>
      <div class="packages">
        <h1>Master</h1>
        <h2 class="text1">&dollar;29.99</h2>
        <h2 class="text2">&dollar;359.99</h2>
        <ul class="list">
          <li class="first">Professional +</li>
          <li>Marketing Automation</li>
          <li>Instagram Ads</li>
          <li>Facebook Ads</li>
        </ul>
        <a href="#" class="button button3">Start Now</a>
      </div>
    </div>
  </div>

  <script src="./script.js"></script>
</body>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Play:wght@400;700&display=swap");

body {
  background-color: #f4f4f4;

  font-family: "Play", sans-serif;
}

.container {
  width: 100%;
}

.packages {
  margin: 20px;
  width: 300px;
  padding-bottom: 1.5em;
  height: 100%;
  background-color: #1e2321;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-radius: 20px;
  box-shadow: 0 19px 38px rgba(30, 35, 33, 1), 0 15px 12px rgba(30, 35, 33, 0.2);
  flex-wrap: wrap;
  color: #f4f4f4;
}

h1,
h2 {
  font-size: 2.2em;
}

.list li {
  font-size: 20px;
  list-style: none;
  border-bottom: 1px solid #f4f4f4;
  padding-inline-start: 0;
  border-width: 1px;
  padding: 10px;
}

.first {
  margin-top: 40px;
  border-top: 1px solid #f4f4f4;
}

.list {
  width: 80%;
}

ol,
ul {
  padding: 0;
}

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

input,
label {
  display: inline-block;
  vertical-align: middle;
  margin: 10px 0;
}

.button {
  padding: 10px 30px;
  text-decoration: none;
  font-size: 1.4em;
  margin: 15px 15px;
  border-radius: 50px;
  color: #f4f4f4;
  transition: all 0.3s ease 0s;
}

.button:hover {
  transform: scale(1.2);
}

.button1 {
  background-color: #00cc99;
  box-shadow: 0 0 10px 0 #00cc99 inset, 0 0 20px 2px #00cc99;
}

.button2 {
  background-color: #ff007c;
  box-shadow: 0 0 10px 0 #ff007c inset, 0 0 20px 2px #ff007c;
}

.button3 {
  background-color: #ffae42;
  box-shadow: 0 0 10px 0 #ffae42 inset, 0 0 20px 2px #ffae42;
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #1e2321;
  -webkit-transition: 0.4s;

  box-shadow: 2px 6px 25px #1e2321;
  transform: translate(0px, 0px);
  transition: 0.6s ease transform, 0.6s box-shadow;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: #50bfe6;
}

input:focus + .slider {
  box-shadow: 0 0 1px #50bfe6;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.package-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

              
            
!

JS

              
                function check() {
  var checkBox = document.getElementById("checbox");
  var text1 = document.getElementsByClassName("text1");
  var text2 = document.getElementsByClassName("text2");

  for (var i = 0; i < text1.length; i++) {
    if (checkBox.checked == true) {
      text1[i].style.display = "block";
      text2[i].style.display = "none";
    } else if (checkBox.checked == false) {
      text1[i].style.display = "none";
      text2[i].style.display = "block";
    }
  }
}
check();

              
            
!
999px

Console