9. Integrating the Files
Folder: 09-combined/
Files: index.html, styles.css, nav.js, carousel.js
Overview
In this exercise, you'll combine all the sections you've built (Exercises 1-8) into a single, complete website. For each section, you'll copy the HTML, CSS, and JavaScript (if applicable) into the destination files.
Your tasks:
- Copy HTML from each exercise into the
index.html - Copy CSS from each exercise into the consolidated
styles.css - Link JavaScript files (
nav.jsandcarousel.js) - Test the complete website
Open 09-combined/index.html and 09-combined/styles.css - you'll see starter files with comments indicating where each section should go.
Integration Steps
1. Navigation
HTML:
- Open
02_nav/index.html - Copy the
<nav class="navigation">element and paste it into09-combined/index.htmlinside the<header>tag (replace the TODO comment)
JavaScript:
- Uncomment the
<script src="nav.js" defer></script>line in the<head>of09-combined/index.html
2. Hero Section
HTML:
- Copy the hero section from
01_hero/index.htmlinto the<main>section where the "HERO SECTION" comment is
CSS:
- Open
01_hero/hero.css - Copy all CSS from that file and paste it into
09-combined/styles.cssin the "HERO SECTION" section. - Make sure that as you create your
09-combined/styles.cssstylesheet, all of the media queries are grouped at the bottom after all of the non-media rulesets.
3. Video Introduction
- Copy
<section id="section-1">from03_video_intro/index.htmlinto09-combined/index.html - Copy all CSS from
03_video_intro/section1.cssinto09-combined/styles.css(regular styles in "SECTION 1", media queries at bottom)
4. What We Do
- Copy
<section id="section-2">from04_what_we_do/index.htmlinto09-combined/index.html - Copy all CSS from
04_what_we_do/section2.cssinto09-combined/styles.css(regular styles in "SECTION 2 - WHAT WE DO", media queries at bottom)
5. Join Our Efforts
- Copy
<section id="section-3">from05_join_our_efforts/index.htmlinto09-combined/index.html - Copy all CSS from
05_join_our_efforts/section3.cssinto09-combined/styles.css(regular styles in "SECTION 3", media queries at bottom)
6. The NYC Nature Map
- Copy
<section id="section-4">from06_data_visualizations/index.htmlinto09-combined/index.html - Copy all CSS from
06_data_visualizations/section4.cssinto09-combined/styles.css(regular styles in "SECTION 4", media queries at bottom)
7. Forests in Cities Network
- Copy
<section id="section-5">from07_forests_in_cities/index.htmlinto09-combined/index.html - Copy all CSS from
07_forests_in_cities/section5.cssinto09-combined/styles.css(regular styles in "SECTION 5", media queries at bottom)
8. Carousel
- Copy
<section id="section-6">from08_carousel/index.htmlinto09-combined/index.html - Uncomment
<script src="carousel.js" defer></script>in the<head> - Copy all CSS from
08_carousel/section6.cssinto09-combined/styles.css(regular styles in "SECTION 6", media queries at bottom)
Important CSS Notes
- Media Query Placement: All media queries should be placed at the bottom of
styles.css, in the "MEDIA QUERIES" section. This ensures proper CSS cascade order. - CSS Already in utility-classes.css: Remember that many styles (like
.card,.btn,.grid, etc.) are already inutility-classes.css, so you only need to copy section-specific styles.
Testing Your Website
-
Open
09-combined/index.htmlin your browser -
Check each section:
- Navigation should work (hamburger menu on mobile)
- Hero section displays correctly
- All sections appear in order
- Images load properly
- Buttons and links work
- Carousel navigation works
-
Test responsive design:
- Resize your browser window
- Test on mobile viewport (DevTools)
- Check that all sections stack/adapt properly on smaller screens