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

Auto Save

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="feedback-container">
    <div class="feedback-header">
      <h2>Share Your Feedback</h2>
      <p>Help us improve our service</p>
    </div>
    
    <form>
      <div class="form-group">
        <label for="name">Name</label>
        <input type="text" id="name" placeholder="Enter your name" required>
      </div>
      
      <div class="form-group">
        <label for="email">Email</label>
        <input type="email" id="email" placeholder="Enter your email" required>
      </div>
      
      <div class="form-group">
        <label for="category">Feedback Category</label>
        <select id="category" required>
          <option value="">Select a category</option>
          <option value="bug">Bug Report</option>
          <option value="feature">Feature Request</option>
          <option value="improvement">Improvement</option>
          <option value="other">Other</option>
        </select>
      </div>
      
      <div class="form-group">
        <label>How satisfied are you?</label>
        <div class="rating-group">
          <button type="button" class="rating-btn" data-rating="1">😔</button>
          <button type="button" class="rating-btn" data-rating="2">😐</button>
          <button type="button" class="rating-btn" data-rating="3">😊</button>
          <button type="button" class="rating-btn" data-rating="4">😃</button>
          <button type="button" class="rating-btn" data-rating="5">🤩</button>
        </div>
      </div>
      
      <div class="form-group">
        <label for="message">Your Message</label>
        <textarea id="message" placeholder="Tell us more about your experience..." required></textarea>
      </div>
      
      <button type="submit" class="submit-btn">Submit Feedback</button>
    </form>
  </div>
</body>
              
            
!

CSS

              
                * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    }

    body {
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    }

    .feedback-container {
      width: 100%;
      max-width: 500px;
      background: white;
      padding: 40px;
      border-radius: 16px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }

    .feedback-header {
      margin-bottom: 30px;
      text-align: center;
    }

    .feedback-header h2 {
      color: #2d3748;
      font-size: 24px;
      margin-bottom: 10px;
    }

    .feedback-header p {
      color: #718096;
      font-size: 16px;
    }

    .form-group {
      margin-bottom: 24px;
    }

    .form-group label {
      display: block;
      margin-bottom: 8px;
      color: #4a5568;
      font-size: 14px;
      font-weight: 500;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
      width: 100%;
      padding: 12px;
      border: 2px solid #e2e8f0;
      border-radius: 8px;
      font-size: 16px;
      transition: all 0.3s ease;
    }

    .form-group input:focus,
    .form-group textarea:focus,
    .form-group select:focus {
      outline: none;
      border-color: #4299e1;
      box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
    }

    .form-group textarea {
      height: 120px;
      resize: vertical;
    }

    .rating-group {
      display: flex;
      gap: 8px;
      margin-bottom: 24px;
    }

    .rating-btn {
      flex: 1;
      padding: 12px;
      border: 2px solid #e2e8f0;
      border-radius: 8px;
      background: white;
      cursor: pointer;
      transition: all 0.3s ease;
      font-size: 20px;
    }

    .rating-btn:hover {
      background: #f7fafc;
    }

    .rating-btn.active {
      background: #4299e1;
      color: white;
      border-color: #4299e1;
      transform: scale(1.05);
    }

    .submit-btn {
      width: 100%;
      padding: 14px;
      background: #4299e1;
      color: white;
      border: none;
      border-radius: 8px;
      font-size: 16px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .submit-btn:hover {
      background: #3182ce;
      transform: translateY(-1px);
    }

    @media (max-width: 480px) {
      .feedback-container {
        padding: 24px;
      }
      
      .rating-group {
        flex-direction: column;
      }
    }
              
            
!

JS

              
                 // Get all rating buttons
    const ratingButtons = document.querySelectorAll('.rating-btn');
    
    // Add click event listener to each button
    ratingButtons.forEach(button => {
      button.addEventListener('click', () => {
        // Remove active class from all buttons
        ratingButtons.forEach(btn => btn.classList.remove('active'));
        
        // Add active class to clicked button
        button.classList.add('active');
      });
    });
              
            
!
999px

Console