Day 1: Introduction to HTML
Topics:
- HTML syntax and structure
- HTML tags and elements
- Headings, paragraphs, and line breaks
- Text formatting with HTML
- Creating lists in HTML
Assignments:
- Create a basic HTML document structure with a title and heading.
<!DOCTYPE html> <html> <head> <title>My First Webpage</title> </head> <body> <h1>Welcome to My Webpage</h1> </body> </html>
- Write a paragraph describing your favorite hobby using appropriate HTML tags.
<!DOCTYPE html> <html> <head> <title>My Hobbies</title> </head> <body> <h2>My Favorite Hobby</h2> <p>I enjoy playing the guitar in my free time. It's a great way to relax and express my creativity.</p> </body> </html>
- Create an ordered list of your top 5 favorite movies.
<!DOCTYPE html> <html> <head> <title>My Favorite Movies</title> </head> <body> <h2>My Top 5 Favorite Movies</h2> <ol> <li>The Shawshank Redemption</li> <li>The Godfather</li> <li>Pulp Fiction</li> <li>The Dark Knight</li> <li>Fight Club</li> </ol> </body> </html>
- Format a piece of text as bold, italic, and underline using HTML tags.
<!DOCTYPE html> <html> <head> <title>Formatted Text</title> </head> <body> <p>This is <b>bold</b> text.</p> <p>This is <i>italic</i> text.</p> <p>This is <u>underlined</u> text.</p> </body> </html>
- Construct an unordered list of your favorite food items.
<!DOCTYPE html> <html> <head> <title>My Favorite Foods</title> </head> <body> <h2>My Favorite Foods</h2> <ul> <li>Pizza</li> <li>Sushi</li> <li>Burger</li> <li>Chocolate</li> <li>Ice Cream</li> </ul> </body> </html>
Day 2: Working with Links and Images
Topics:
- Creating hyperlinks with anchor tags
- Linking to external websites and internal sections
- Inserting images in HTML
- Image attributes and alternative text
Assignments:
- Create a hyperlink that opens a new tab and leads to your favorite website.
<!DOCTYPE html> <html> <head> <title>My Webpage</title> </head> <body> <h1>Welcome to My Webpage</h1> <a href="https://www.example.com" target="_blank">Visit Example.com</a> </body> </html>
- Link an internal section within the same webpage using anchor tags.
<!DOCTYPE html> <html> <head> <title>My Webpage</title> </head> <body> <h1>Welcome to My Webpage</h1> <a href="#about">Jump to About Section</a> <h2 id="about">About</h2> <p>This is the About section of my webpage.</p> </body> </html>
- Insert an image of your favorite animal with appropriate alt text.
<!DOCTYPE html> <html> <head> <title>My Webpage</title> </head> <body> <h1>Welcome to My Webpage</h1> <img src="animal.jpg" alt="A picture of my favorite animal"> </body> </html>
- Create a gallery of three images using HTML and appropriate attributes.
<!DOCTYPE html> <html> <head> <title>Image Gallery</title> </head> <body> <h2>Image Gallery</h2> <img src="image1.jpg" alt="Image 1"> <img src="image2.jpg" alt="Image 2"> <img src="image3.jpg" alt="Image 3"> </body> </html>
- Add a link around an image that opens another webpage when clicked.
<!DOCTYPE html> <html> <head> <title>My Webpage</title> </head> <body> <h1>Welcome to My Webpage</h1> <a href="https://www.example.com" target="_blank"> <img src="image.jpg" alt="Image"> </a> </body> </html>
Day 3: Tables and Forms
Topics:
- Creating tables in HTML
- Table rows and cells
- Table headers and data
- Form elements and input types
- Form submission and handling
Assignments:
- Create a table to display a simple schedule with days of the week and corresponding activities.
<!DOCTYPE html> <html> <head> <title>Weekly Schedule</title> </head> <body> <h2>Weekly Schedule</h2> <table> <tr> <th>Day</th> <th>Activity</th> </tr> <tr> <td>Monday</td> <td>Gym</td> </tr> <tr> <td>Tuesday</td> <td>Work</td> </tr> <tr> <td>Wednesday</td> <td>Music Lessons</td> </tr> <tr> <td>Thursday</td> <td>Study Group</td> </tr> <tr> <td>Friday</td> <td>Movie Night</td> </tr> </table> </body> </html>
- Create a form with input fields for name, email, and message, and a submit button.
<!DOCTYPE html> <html> <head> <title>Contact Form</title> </head> <body> <h2>Contact Form</h2> <form action="submit.php" method="POST"> <label for="name">Name:</label> <input type="text" id="name" name="name" required><br><br> <label for="email">Email:</label> <input type="email" id="email" name="email" required><br><br> <label for="message">Message:</label> <textarea id="message" name="message" required></textarea><br><br> <input type="submit" value="Submit"> </form> </body> </html>
Day 4: CSS Styling
Topics:
- CSS syntax and selectors
- Applying styles to HTML elements
- Working with colors, backgrounds, and borders
- Formatting text with CSS
- Creating layouts with CSS
Assignments:
- Style the headings in your webpage using CSS.
<!DOCTYPE html> <html> <head> <title>My Webpage</title> <style> h1 { color: blue; font-size: 24px; } h2 { color: green; font-size: 20px; } </style> </head> <body> <h1>Welcome to My Webpage</h1> <h2>About Me</h2> <!-- Rest of the content --> </body> </html>
- Add a background color and padding to the paragraphs in your webpage using CSS.
<!DOCTYPE html> <html> <head> <title>My Webpage</title> <style> p { background-color: lightgray; padding: 10px; } </style> </head> <body> <p>This is a paragraph.</p> <p>This is another paragraph.</p> <!-- Rest of the content --> </body> </html>
- Create a navigation bar using an unordered list and style it with CSS.
html <!DOCTYPE html> <html> <head> <title>My Webpage</title> <style> ul { list-style-type: none; margin: 0; padding: 0; background-color: #333; } li { display: inline-block; margin-right: 10px; } a { color: white; text-decoration: none; padding: 10px; } </style> </head> <body> <ul> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> <li><a href="#">Services</a></li> <li><a href="#">Contact</a></li> </ul> </body> </html>
Day 5: JavaScript Basics
Topics:
- Introduction to JavaScript
- Variables and data types
- Operators and expressions
- Control flow statements (if-else, switch)
- Functions and event handling
Assignments:
- Create a JavaScript function that calculates the sum of two numbers and displays the result.
<!DOCTYPE html> <html> <head> <title>Calculator</title> <script> function calculateSum() { var num1 = parseInt(document.getElementById('num1').value); var num2 = parseInt(document.getElementById('num2').value); var sum = num1 + num2; document.getElementById('result').innerHTML = "Sum: " + sum; } </script> </head> <body> <h2>Calculator</h2> <input type="number" id="num1" placeholder="Enter number 1"><br><br> <input type="number" id="num2" placeholder="Enter number 2"><br><br> <button onclick="calculateSum()">Calculate Sum</button> <p id="result"></p> </body> </html>
- Create a JavaScript function that validates a form and displays an error message if any field is empty.
<!DOCTYPE html> <html> <head> <title>Form Validation</title> <script> function validateForm() { var name = document.getElementById('name').value; var email = document.getElementById('email').value; var message = document.getElementById('message').value; if (name === "" || email === "" || message === "") { alert("All fields are required!"); return false; } } </script> </head> <body> <h2>Contact Form</h2> <form action="submit.php" method="POST" onsubmit="return validateForm()"> <label for="name">Name:</label> <input type="text" id="name" name="name"><br><br> <label for="email">Email:</label> <input type="email" id="email" name="email"><br><br> <label for="message">Message:</label> <textarea id="message" name="message"></textarea><br><br> <input type="submit" value="Submit"> </form> </body> </html>