Reducing the number of div elements in your HTML can improve code readability, maintainability, and semantic clarity. Instead of relying on generic div elements, you can use more appropriate semantic HTML elements where possible. Here's how you can refactor your code to reduce the number of divs:
Refactored Code with Reduced divs
<section class="personal-goals">
<h2>My Zero-Waste Goals</h2>
<hr>
<p>As a student just starting my zero-waste journey, I'm exploring ways to reduce my environmental impact and develop sustainable habits.</p>
<!-- Replace div with article for better semantics -->
<article class="goals-grid">
<section class="goal-card">
<header class="goal-header">
🥤 <!-- Emoji as content -->
<h3 class="goal-title">Eliminate Single-Use Plastics</h3>
</header>
<p class="goal-description">Commit to reducing plastic waste by avoiding single-use items. Opt for biodegradable or compostable alternatives for straws, utensils, and packaging.</p>
<footer class="progress-container">
<progress class="progress-bar" value="50" max="100"></progress>
<span class="progress-text">50% Complete</span>
</footer>
</section>
<section class="goal-card">
<header class="goal-header">
📦 <!-- Emoji as content -->
<h3 class="goal-title">Use Reusable Containers</h3>
</header>
<p class="goal-description">Embrace sustainability by using glass or stainless steel containers for food storage and transport. This reduces reliance on disposable packaging and promotes a zero-waste lifestyle.</p>
<footer class="progress-container">
<progress class="progress-bar" value="30" max="100"></progress>
<span class="progress-text">30% Complete</span>
</footer>
</section>
</article>
</section>
<section class="challenges-section">
<h2>Challenges & Solutions</h2>
<p>Every journey toward sustainability comes with obstacles. Here are the main challenges I face as a student pursuing zero-waste living, along with practical solutions I've developed to overcome them.</p>
<!-- Replace div with article for better semantics -->
<article class="challenges-grid">
<section class="challenge-card">
<header class="challenge-header">
💰 <!-- Emoji as content -->
<h3 class="challenge-title">Budget Constraints</h3>
</header>
<p class="challenge-problem">As a student, initial costs for reusable items like good water bottles can be expensive.</p>
<p class="challenge-solution">
<strong>Solution:</strong> I can start small with one item at a time and consider it a long-term investment that saves money.
</p>
</section>
<section class="challenge-card">
<header class="challenge-header">
⏰ <!-- Emoji as content -->
<h3 class="challenge-title">Convenience vs Sustainability</h3>
</header>
<p class="challenge-problem">Busy study schedules make it tempting to choose convenient disposable options, especially during exam periods.</p>
<p class="challenge-solution">
<strong>Solution:</strong> Prepare reusable items in advance, set reminders, and make sustainable choices as easy as possible by keeping items accessible.
</p>
</section>
</article>
</section>