Development Environment Setup: Creating First Project

Now that your environment is set up, let’s create your first web project! If you missed that part, please refer to the previous session regrading environment setup.

Project Setup Steps

Step 1: Create Project Folder

Open your terminal and create a project folder:

# Navigate to where you want to store projects
# Create a projects folder (if it doesn't exist)
mkdir web-projects

# Navigate into it
cd web-projects

# Create your first project folder
mkdir my-first-website

# Navigate into the project
cd my-first-website

Step 2: Open in VS Code

# Open the current folder in VS Code
code .

This opens VS Code with your project folder ready.

Step 3: Create Project Files

Using VS Code:

  1. Click the “New File” icon in the Explorer panel
  2. Create these files:
    • index.html
    • styles.css
    • script.js

Your First HTML File

Open index.html and type this code:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My First Website</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <header>
        <h1>Welcome to My First Website</h1>
        <nav>
            <ul>
                <li><a href="#about">About</a></li>
                <li><a href="#projects">Projects</a></li>
                <li><a href="#contact">Contact</a></li>
            </ul>
        </nav>
    </header>

    <main>
        <section id="about">
            <h2>About Me</h2>
            <p>I'm learning web development and building amazing websites!</p>
        </section>

        <section id="projects">
            <h2>My Projects</h2>
            <p>Coming soon...</p>
        </section>

        <section id="contact">
            <h2>Contact</h2>
            <p>Email: student@university.edu</p>
        </section>
    </main>

    <footer>
        <p>&copy; 2026 My First Website</p>
    </footer>

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

Your First CSS File

Open styles.css and add:

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Header styles */
header {
    background-color: #007bff;
    color: white;
    padding: 1rem 0;
    text-align: center;
}

header h1 {
    margin-bottom: 1rem;
}

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

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

nav a:hover {
    text-decoration: underline;
}

/* Main content */
main {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

section {
    margin-bottom: 2rem;
}

h2 {
    color: #007bff;
    margin-bottom: 1rem;
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

Your First JavaScript File

Open script.js and add:

// This runs when the page loads
console.log("Welcome to my first website!");

// Display a welcome message
document.addEventListener('DOMContentLoaded', function() {
    console.log("Page is fully loaded and ready!");
    
    // You can add interactive features here later
});

Step 4: View Your Website

Method 1: Using Live Server (Recommended)

  1. Right-click on index.html in VS Code
  2. Select “Open with Live Server” (Need to use Live Server extension in vscode)
  3. Your website opens in the browser
  4. Any changes you make will auto-reload!

Method 2: Direct File Opening

  1. In VS Code, right-click index.html
  2. Select “Reveal in File Explorer” (Windows) or “Reveal in Finder” (macOS)
  3. Double-click index.html to open in your default browser

Step 5: Inspect Your Work

  1. Open Chrome DevTools (F12)
  2. Click on the Elements tab
  3. Hover over different elements to see them highlighted
  4. Try changing some CSS in the Styles pane
  5. Open the Console tab and see your JavaScript message

Congratulations! You’ve created your first website!

Project Organization Best Practices

As you build more projects, good organization becomes crucial:

Recommended Folder Structure

my-project/
├── index.html
├── about.html
├── contact.html
├── css/
│ ├── styles.css
│ └── responsive.css
├── js/
│ ├── script.js
│ └── utils.js
├── images/
│ ├── logo.png
│ └── hero.jpg
├── fonts/
│ └── custom-font.woff2
└── README.md

Benefits:

  • Easy to find files
  • Scalable as the project grows
  • Standard structure recognizable to other developers
  • Clean and professional

File Naming Conventions

Do:

  • Use lowercase: index.html, styles.css
  • Use hyphens for spaces: about-us.html, main-styles.css
  • Be descriptive: contact-form.js, not form.js
  • Use consistent naming patterns

Don’t:

  • Use spaces: my file.html (causes issues)
  • Use special characters: contact!.html
  • Mix cases randomly: AboutUs.html

Practice Exercises

Reinforce your learning with these exercises:

Exercise 1: Customize Your Site

  1. Change the colors in styles.css
  2. Add a new section to index.html
  3. Modify the navigation links
  4. Add your own content

Exercise 2: DevTools Exploration

  1. Add a border to an element
  2. Open your website in Chrome
  3. Open DevTools (F12)
  4. Change the background color using Elements panel
  5. Modify the heading text

Exercise 3: Terminal Practice

Create this folder structure using only terminal commands:

practice/
├── project-1/
│ ├── index.html
│ └── style.css
└── project-2/
├── index.html
└── style.css

Exercise 4: Multi-Page Site

  1. Create a new HTML file called about.html
  2. Copy the structure from index.html
  3. Change the content
  4. Link to it from your navigation

Essential Resources

VS Code Documentation:

Chrome DevTools:

Terminal Learning:

What’s Next?

Now that your development environment is configured, you’re ready to dive deep into HTML and learn how to structure web content properly.

Next Lesson: HTML Essentials – Master document structure, semantic elements, forms, and HTML best practices

Leave a Reply

Your email address will not be published. Required fields are marked *