Ask me anything
Ithy Logo
Sign in to save

E-Waste Awareness Website Code

A comprehensive guide to create a responsive e-waste sensitization website

electronic devices recycling center

Highlights

  • Interactive and Informative Structure: The website is built with HTML, CSS, and JavaScript to educate users on e-waste management, highlight environmental impacts, and provide resources for recycling.
  • Responsive Design and User Engagement: Responsive layouts, smooth scrolling, interactive forms, and content sections ensure a dynamic user experience, with navigation links to various parts of the site.
  • Comprehensive Resource Integration: Includes detailed content sections, a recycling center finder table, and an actionable subscription form to further engage and guide visitors.

Introduction

Electronic waste, or e-waste, has grown tremendously over the years due to the rapid pace of technological growth and consumer electronics turnover. Improper disposal of electronic devices can release hazardous chemicals into the environment, such as lead, mercury, and cadmium, which affect not only ecological systems but also human health. The importance of proper e-waste management cannot be overemphasized. Creating an informative and engaging website to sensitize people about the dangers of e-waste and how to manage it responsibly is a critical initiative in protecting our environment.

Website Structure Overview

The website is designed with a clear, user-friendly interface, and is segmented into different sections: Home – Provides a welcome message, introduction to e-waste, and calls to action. About E-Waste – Explains what e-waste is and highlights its potential environmental and health hazards. Environmental Impact – Details the negative consequences of improper e-waste disposal. Recycling Centers – Provides interactive elements including a facility locator and a table of available recycling centers. Get Involved – Encourages users to subscribe for updates and get involved in community initiatives.


Complete Website Code

Below is the complete integrated code for an e-waste awareness website. This single-page code integrates all essential parts (HTML structure, CSS styling, and JavaScript functionality) in one reusable file.


  <!-- index.html -->
  <!DOCTYPE html>
  <html lang="en">
  <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>E-Waste Awareness</title>
      <style>
          /* Basic Reset */
          * {
              margin: 0;
              padding: 0;
              box-sizing: border-box;
          }

          body {
              font-family: Arial, sans-serif;
              background-color: #f4f4f4;
              color: #333;
              line-height: 1.6;
          }

          header {
              background-color: #002a54;
              color: #fff;
              text-align: center;
              padding: 1.5em 0;
          }

          nav {
              background-color: #34495e;
              overflow: hidden;
          }

          nav ul {
              list-style: none;
              display: flex;
              justify-content: center;
          }

          nav ul li {
              margin: 0 15px;
          }

          nav ul li a {
              color: #f2f2f2;
              text-decoration: none;
              padding: 14px 20px;
              display: block;
          }

          nav ul li a:hover {
              background-color: #ddd;
              color: black;
          }

          .container {
              padding: 20px;
              margin: 20px auto;
              max-width: 1000px;
              background-color: #fff;
              border-radius: 5px;
              box-shadow: 0 0 10px rgba(0,0,0,0.1);
          }

          h1, h2 {
              color: #cc9900;
          }

          h3 {
              color: #388278;
          }

          h4 {
              color: #7FA86E;
          }

          /* Home Section */
          #hero {
              text-align: center;
              padding: 50px 20px;
          }

          #hero h1 {
              font-size: 2.5em;
              margin-bottom: 10px;
          }

          #hero p {
              font-size: 1.2em;
              margin-bottom: 20px;
          }

          button {
              background-color: #002a54;
              color: #fff;
              border: none;
              padding: 10px 20px;
              font-size: 1em;
              cursor: pointer;
              border-radius: 5px;
          }

          button:hover {
              background-color: #001f41;
          }

          /* Section Styling */
          section {
              margin: 40px 0;
          }

          section p {
              margin: 15px 0;
          }

          /* Table for Recycling Centers */
          table {
              width: 100%;
              border-collapse: collapse;
              margin-top: 20px;
          }
          
          table, th, td {
              border: 1px solid #ddd;
          }
          
          th, td {
              padding: 12px;
              text-align: left;
          }
          
          th {
              background-color: #002a54;
              color: #fff;
          }

          /* Subscription/Contact Form */
          form {
              display: flex;
              flex-direction: column;
              max-width: 400px;
              margin: 20px auto;
          }

          form input[type="email"],
          form input[type="text"] {
              padding: 10px;
              margin-bottom: 10px;
              border: 1px solid #ccc;
              border-radius: 5px;
          }

          form button {
              align-self: center;
          }

          /* Footer Section */
          footer {
              background-color: #002a54;
              color: #fff;
              text-align: center;
              padding: 15px 0;
              position: relative;
          }
      </style>
  </head>
  <body>
      <header>
          <h1>E-Waste Awareness</h1>
          <h3>Your guide to a cleaner, safer digital world</h3>
      </header>
      <nav>
          <ul>
              <li><a href="#hero">Home</a></li>
              <li><a href="#about">About E-Waste</a></li>
              <li><a href="#impact">Environmental Impact</a></li>
              <li><a href="#recycling">Recycling Centers</a></li>
              <li><a href="#involvement">Get Involved</a></li>
          </ul>
      </nav>
      <div class="container">
          <!-- Home Section -->
          <section id="hero">
              <h2>Welcome to E-Waste Awareness</h2>
              <p>Discover the dangers of electronic waste and learn how to responsibly manage and recycle your old devices!</p>
              <button onclick="document.getElementById('about').scrollIntoView({ behavior: 'smooth' });">Learn More</button>
          </section>
  
          <!-- About E-Waste Section -->
          <section id="about">
              <h2>What is E-Waste?</h2>
              <p>
                  Electronic waste refers to discarded electrical or electronic devices. These include computers, mobile phones, televisions, and household appliances. When disposed of improperly, e-waste can release hazardous substances into our soil and water, posing a serious risk to the environment and public health.
              </p>
              <h4>Key Points:</h4>
              <ul>
                  <li>E-waste contains toxic materials like lead, mercury, and cadmium.</li>
                  <li>Improper disposal can cause significant environmental pollution.</li>
                  <li>Recycling and responsible disposal methods can mitigate these risks.</li>
              </ul>
          </section>
  
          <!-- Environmental Impact Section -->
          <section id="impact">
              <h2>Environmental Impact of E-Waste</h2>
              <p>
                  When electronic devices are discarded carelessly, they end up in landfills, and harmful chemicals seep into the ground and water. These toxic elements can contaminate soil and water sources and negatively affect human health, leading to issues such as respiratory problems, neurological damage, and even cancer.
              </p>
              <h4>Impacts Include:</h4>
              <ul>
                  <li>Soil contamination from heavy metals</li>
                  <li>Water pollution affecting aquatic life and human health</li>
                  <li>Air pollution from toxic fumes during improper recycling processes</li>
              </ul>
          </section>
  
          <!-- Recycling Centers Section -->
          <section id="recycling">
              <h2>Find Recycling Centers Near You</h2>
              <p>
                  Taking proactive steps to recycle e-waste can mitigate these environmental hazards. Search for local recycling centers using our handy tool, and review a sample table of centers below.
              </p>
              <h4>Search for a Center:</h4>
              <form id="recycling-form">
                  <input type="text" placeholder="Enter your city or zip code" required>
                  <button type="button" onclick="searchCenters()">Search</button>
              </form>
              <div id="results"></div>
              <h4>Sample Recycling Centers</h4>
              <table>
                  <tr>
                      <th>Center Name</th>
                      <th>Address</th>
                      <th>Contact</th>
                  </tr>
                  <tr>
                      <td>GreenCycle Recycling</td>
                      <td>123 Elm Street, Springfield</td>
                      <td>(555) 123-4567</td>
                  </tr>
                  <tr>
                      <td>Eco Renew Solutions</td>
                      <td>456 Oak Avenue, Riverdale</td>
                      <td>(555) 987-6543</td>
                  </tr>
              </table>
          </section>
  
          <!-- Get Involved Form Section -->
          <section id="involvement">
              <h2>Get Involved & Stay Updated</h2>
              <p>
                  Join our e-waste awareness community! Subscribe to receive updates, news, and tips on responsible e-waste disposal.
              </p>
              <form id="subscription-form">
                  <input type="email" placeholder="Enter your email" required>
                  <button type="submit">Subscribe</button>
              </form>
          </section>
      </div>
  
      <footer>
          <p>© 2025 E-Waste Awareness Initiative. All rights reserved.</p>
      </footer>
  
      <script>
          // Smooth scrolling for navigation links
          document.querySelectorAll('nav a[href^="#"]').forEach(anchor => {
              anchor.addEventListener('click', function (e) {
                  e.preventDefault();
                  document.querySelector(this.getAttribute('href')).scrollIntoView({
                      behavior: 'smooth'
                  });
              });
          });
  
          // JavaScript for Subscription Form Alert
          const subscriptionForm = document.getElementById('subscription-form');
          if (subscriptionForm) {
              subscriptionForm.addEventListener('submit', function(e) {
                  e.preventDefault();
                  alert('Thank you for subscribing to E-Waste Awareness updates!');
                  subscriptionForm.reset();
              });
          }
  
          // Placeholder function for recycling centers search mechanism
          function searchCenters() {
              const input = document.querySelector('#recycling-form input[type="text"]').value;
              const resultsDiv = document.getElementById('results');
              if (input.trim() === "") {
                  resultsDiv.innerHTML = "<p>Please enter a valid location.</p>";
                  return;
              }
              // For demonstration, simulating a fetch
              // Ideally, you would fetch data from an API
              const centers = [
                  { name: "Recycling Hub", address: "789 Maple Rd, Centerville", contact: "(555) 321-7654" },
                  { name: "Eco Tech Recycle", address: "101 Pine St, Lakeview", contact: "(555) 654-0987" }
              ];
              let output = "<h4>Search Results:</h4>";
              centers.forEach(center => {
                  output += `<p><strong>${center.name}</strong> - ${center.address} | Contact: ${center.contact}</p>`;
              });
              resultsDiv.innerHTML = output;
          }
      </script>
  </body>
  </html>
  

Detailed Explanation

The website code above is divided into several main sections:

1. HTML Structure

The HTML portion provides the skeleton of the website. It includes:

  • Header: Displays the site title and a catchy subtitle. The header uses a dark blue background (#002a54) combined with a contrasting text color for high visibility.
  • Navigation: A responsive navigation bar that contains links to each main section within the website. Smooth scrolling is implemented through JavaScript, enhancing user experience.
  • Main Content Sections: Structured in distinct sections, including:
    • The Home Section welcomes visitors with a brief introduction and a call-to-action button.
    • The About Section describes e-waste, its harmful chemicals, and why safe disposal matters.
    • The Environmental Impact Section details the various environmental and health risks associated with improper e-waste disposal.
    • The Recycling Centers Section allows users to search for nearby recycling centers and view a sample table containing center details.
    • The Get Involved Section offers a subscription form so that users can receive more information and updates regarding e-waste management.
  • Footer: Concludes the page with copyright information, styled consistently with the header to emphasize the overall design theme.

2. CSS Styling

The embedded CSS styles define the look and feel of the website. Major style aspects include:

  • Global reset for margins and padding to maintain consistency across browsers.
  • Color schemes set for different header levels: h1 and h2 use #cc9900, h3 uses #388278, and h4 utilizes #7FA86E.
  • A responsive layout that centers the main .container div, ensuring that content remains readable on various screen sizes.
  • Table styling for the recycling centers, making data easy to read and well-organized.

3. JavaScript Functionality

JavaScript is used to enhance interactivity:

  • Smooth Scrolling: Each navigation link calls a JavaScript function to smoothly scroll to the linked section, enhancing navigation.
  • Subscription Form: A simple form is used for email subscription. On submission, an alert thanks the visitor, and the form is reset.
  • Recycling Center Search: The search function simulates searching for recycling centers. In practice, this function can be integrated with an API to fetch real data based on the user's location.

4. Additional Elements and Interactivity

Beyond the core elements, the website offers:

  • An engaging call-to-action in the home section encouraging further exploration of the content.
  • A clear display and table listing sample recycling centers for quick reference.
  • Practical CSS styling that enhances the visual impact and readability of the content.

Additional Content: The Impact of E-Waste

It is crucial to understand the impact of e-waste to inspire change. Below is a brief table to summarise the key environmental hazards:

Hazard Description
Lead Causes neurological damage and contaminates water sources.
Mercury Affects brain and kidney functions, leading to serious health issues.
Cadmium Biologically accumulative; damages kidneys and bones.

These examples underscore why managing e-waste through responsible recycling practices is critical for health and environmental sustainability.


Conclusion and Final Thoughts

In conclusion, the provided code represents a comprehensive, interactive, and responsive website for sensitizing the public about e-waste. By combining engaging content with interactive tools, such as a recycling center locator and subscription form, the site not only educates users about the dangers of improper e-waste disposal but also empowers them to take actionable steps. The design integrates best practices in web development with a clear focus on usability, responsiveness, and visual appeal. As our digital consumption grows, websites like this play a crucial role in prompting communities and individuals to rethink waste management strategies. This comprehensive approach to web design is an effective tool for promoting sustainable practices, thereby contributing to a cleaner and safer environment.


References

Recommended Next Steps

greene.gov.in
eWaste

Last updated February 21, 2025

AI-assisted research. Sources, methodology and corrections · Source-checked guides and tools · Explore published answers

Ask Ithy AI