Skip to main content

Command Palette

Search for a command to run...

frontend

Updated
β€’12 min read
frontend
K

I am a developer from India....


πŸ“… DAY 1: HTML BASICS


⭐ 1. Overview of Web Development

πŸ“Œ What is Web Development?

Web Development is the process of creating websites or web applications for the internet. It involves designing the structure, appearance, and interactivity of a website.

πŸ“Œ Types of Web Development:

  1. Frontend: User-facing side of websites using HTML, CSS, JavaScript.

  2. Backend: Server-side logic, databases (e.g., Node.js, Python, PHP).

  3. Full Stack: Combination of frontend and backend.

πŸ“Œ Features of a Web Developer:

  • Proficiency in HTML, CSS, JS

  • Debugging and problem-solving skills

  • Familiarity with browser developer tools

  • Use of version control (Git)

  • Knowledge of responsive design and frameworks (Bootstrap, React, Vue)


⭐ 2. Emmet Abbreviations

πŸ“Œ What is Emmet?

Emmet is a shortcut tool in code editors (VS Code, Sublime Text) that speeds up writing HTML and CSS using abbreviations.

πŸ“Œ Examples:

EmmetExpands To
!Boilerplate HTML
ul>li*3Creates <ul> with 3 <li>
div.container>h1+pA div with class and child elements

πŸ“Œ Example:

<!-- Emmet: ! -->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My First Web Page</title>
</head>
<body>

</body>
</html>

⭐ 3. Meta Tags, Headings & Paragraphs

πŸ“Œ Meta Tags:

Meta tags go inside <head> and provide metadata about the web page.

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Free Web Development Tutorial">

πŸ“Œ Headings:

Used to define headings from level 1 to 6.

<h1>Main Heading</h1>
<h2>Subheading</h2>
<h3>Minor Heading</h3>

πŸ“Œ Paragraphs:

Used for writing text content.

<p>This is a paragraph.</p>

⭐ 4. Anchor Tags, Lists & Tables

πŸ“Œ Anchor Tags:

Used to create hyperlinks.

<a href="https://www.google.com" target="_blank">Go to Google</a>

πŸ“Œ Lists:

Unordered List:

<ul>
  <li>HTML</li>
  <li>CSS</li>
</ul>

Ordered List:

<ol>
  <li>Step 1</li>
  <li>Step 2</li>
</ol>

πŸ“Œ Tables:

Used to display tabular data.

<table border="1">
  <tr>
    <th>Name</th>
    <th>Age</th>
  </tr>
  <tr>
    <td>Alice</td>
    <td>24</td>
  </tr>
</table>

⭐ 5. Forms & Input Tags

πŸ“Œ Forms:

Used to collect user input.

<form action="/submit" method="post">
  <label>Name:</label>
  <input type="text" name="name"><br><br>

  <label>Email:</label>
  <input type="email" name="email"><br><br>

  <input type="submit" value="Submit">
</form>

πŸ“Œ Common Input Types:

  • text

  • email

  • password

  • radio

  • checkbox

  • submit

  • reset


⭐ 6. Inline vs Block Elements

πŸ“Œ Block Elements:

Start on a new line and take full width.
Examples: <div>, <h1>, <p>, <form>, <table>

πŸ“Œ Inline Elements:

Do not start on a new line. Only take necessary width.
Examples: <span>, <a>, <img>, <input>, <label>

πŸ“Œ Example:

<p>This is a <span style="color:red">red word</span> in a paragraph.</p>

πŸ“… DAY 2: ADVANCED HTML


⭐ 1. IDs and Classes

πŸ“Œ ID:

Unique identifier for one element.

<p id="intro">Welcome to Web Development!</p>

πŸ“Œ Class:

Reusable name for multiple elements.

<p class="highlight">This is important.</p>
<p class="highlight">This is also important.</p>

πŸ“Œ CSS Usage:

<style>
  #intro { color: green; }
  .highlight { background-color: yellow; }
</style>

⭐ 2. HTML Entities

πŸ“Œ Used to display reserved or special characters.

CharacterEntity
<&lt;
>&gt;
&&amp;
"&quot;
'&apos;
<p>5 &lt; 10 and 10 &gt; 5</p>
<p>Tom &amp; Jerry</p>

⭐ 3. Semantic HTML

πŸ“Œ What is Semantic HTML?

Semantic HTML uses tags that describe their meaning, improving SEO and accessibility.

TagPurpose
<header>Top section
<nav>Navigation
<main>Main content
<section>Grouping
<article>Independent content
<footer>Bottom section

πŸ“Œ Example:

<header><h1>My Blog</h1></header>
<nav><a href="#">Home</a></nav>
<main>
  <section>
    <h2>Post Title</h2>
    <p>Blog post content...</p>
  </section>
</main>
<footer>&copy; 2025 My Blog</footer>

⭐ 4. SEO Basics

πŸ“Œ SEO (Search Engine Optimization):

Improves website visibility on search engines.

πŸ“Œ HTML SEO Tips:

  • Use proper heading hierarchy.

  • Include <title> and <meta description>.

  • Use semantic tags.

  • Use alt attributes for images.

  • Use meaningful link texts.

πŸ“Œ Example:

<title>Learn HTML - Beginner's Guide</title>
<meta name="description" content="Step-by-step tutorial to learn HTML.">

🎯 PROJECTS


πŸ“Œ 1. Google Form Clone

<h2>Feedback Form</h2>
<form>
  <label>Name:</label><br>
  <input type="text" name="name"><br><br>

  <label>Choose Subject:</label><br>
  <select>
    <option>HTML</option>
    <option>CSS</option>
    <option>JS</option>
  </select><br><br>

  <label>Rate Us:</label><br>
  <input type="radio" name="rating"> Good
  <input type="radio" name="rating"> Excellent<br><br>

  <input type="submit">
</form>

πŸ“Œ 2. Registration Form

<h2>Register Here</h2>
<form>
  <label for="name">Full Name:</label>
  <input type="text" id="name" name="fullname"><br><br>

  <label for="email">Email:</label>
  <input type="email" id="email" name="email"><br><br>

  <label for="pass">Password:</label>
  <input type="password" id="pass" name="password"><br><br>

  <label>Gender:</label>
  <input type="radio" name="gender"> Male
  <input type="radio" name="gender"> Female<br><br>

  <label>Course:</label><br>
  <input type="checkbox" name="course"> HTML
  <input type="checkbox" name="course"> CSS
  <input type="checkbox" name="course"> JS<br><br>

  <input type="submit" value="Register">
</form>

πŸ”Ά DAY 2: Learn the Basics of CSS

1. CSS BASICS

CSS (Cascading Style Sheets) is used to describe the presentation of a document written in HTML. CSS controls the layout, colors, fonts, spacing, and overall appearance of the web page.

Basic Syntax:

selector {
  property: value;
}

Example:

body {
  background-color: lightblue;
  font-family: Arial, sans-serif;
}

Ways to apply CSS:

  • Inline: <p style="color:red">Hello</p>

  • Internal: Inside <style> tag in HTML

  • External: Link to .css file


2. CSS SELECTORS

Types of Selectors:

  • Universal Selector (*): Selects all elements

  • Element Selector (p): Selects specific HTML elements

  • Class Selector (.classname): Selects all elements with a given class

  • ID Selector (#id): Selects a single element with a specific ID

  • Group Selector (h1, p): Applies styles to multiple elements

  • Descendant Selector (div p): Selects <p> inside <div>

Example:

* {
  margin: 0;
  padding: 0;
}
.container {
  background-color: #f0f0f0;
}
#title {
  color: green;
}
div p {
  font-size: 16px;
}

3. POSITIONING

CSS positioning determines how elements are placed in the document.

  • Static (default): normal flow

  • Relative: positioned relative to its normal position

  • Absolute: relative to the nearest positioned ancestor

  • Fixed: fixed in the viewport (stays during scroll)

  • Sticky: toggles between relative and fixed based on scroll position

Example:

.box {
  position: absolute;
  top: 100px;
  left: 50px;
}

4. BOX MODEL

The box model describes the rectangular boxes that are generated for elements:

  • Content: The actual content

  • Padding: Space around the content

  • Border: Surrounds the padding

  • Margin: Space outside the border

Example:

div {
  width: 200px;
  padding: 20px;
  border: 5px solid black;
  margin: 15px;
}

5. DISPLAY

Defines how an element is displayed:

  • block – starts on a new line, takes full width

  • inline – flows with text, no width/height

  • inline-block – behaves like inline, but allows width/height

  • none – hides the element

  • flex / grid – used for layouts

Example:

span {
  display: inline-block;
  width: 100px;
}

6. SPECIFICITY

Used to determine which rule applies when there are multiple rules for an element.

Selector TypeSpecificity Value
Inline Styles1000
ID Selectors100
Class/Pseudo-class10
Element Selectors1

Example:

<style>
  div { color: red; }       /* Specificity: 1 */
  .box { color: blue; }     /* Specificity: 10 */
  #main { color: green; }   /* Specificity: 100 */
</style>
<div id="main" class="box">Hello</div>
<!-- Text will be green -->

7. FLEXBOX

A one-dimensional layout model to distribute space within a container.

Container Properties:

  • display: flex;

  • flex-direction: row | column

  • justify-content: center | space-between | space-around

  • align-items: stretch | center | flex-start | flex-end

Example:

.container {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

πŸ”Ά DAY 3: Advanced CSS

1. CSS GRID

A two-dimensional system for layout (rows and columns).

Example:

.container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 10px;
}

HTML:

<div class="container">
  <div>1</div>
  <div>2</div>
  <div>3</div>
</div>

2. MEDIA QUERIES

Used to apply different styles based on device size or type.

Syntax:

@media (max-width: 768px) {
  body {
    background-color: yellow;
  }
}

3. PSEUDO-CLASSES

Apply styles to elements based on their state.

  • :hover, :active, :focus

  • :nth-child(n)

Example:

a:hover {
  color: red;
}
li:nth-child(odd) {
  background-color: #f2f2f2;
}

4. BOX SHADOW

Adds shadow effects to elements.

Example:

.card {
  box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.3);
}

5. VARIABLES

Define custom CSS properties.

Example:

:root {
  --primary-color: #3498db;
  --padding: 20px;
}
.button {
  background-color: var(--primary-color);
  padding: var(--padding);
}

6. ANIMATIONS & KEYFRAMES

Create smooth animations by changing CSS properties over time.

Example:

@keyframes slidein {
  from { transform: translateX(0); }
  to { transform: translateX(200px); }
}
.box {
  animation: slidein 2s infinite;
}

7. TRANSITIONS

Create smooth changes between property values.

Example:

.button {
  background-color: blue;
  transition: background-color 0.5s ease;
}
.button:hover {
  background-color: green;
}

πŸ”Ή Mini Projects

1. Login Form

  • Styled using Flexbox and Box Shadow

  • Includes transition on button hover

2. Landing Page

  • Responsive layout

  • Hero section with background image

  • Navigation bar with hover effects

3. Amazon Clone (Mini UI)

  • Grid layout for product items

  • Styled buttons, navbar using Flexbox

  • Responsive design with media queries

4. WhatsApp Clone (UI Only)

  • Sidebar + Chat section with Flexbox

  • Chat bubbles using pseudo-elements

  • Dark mode with CSS variables

    Here's the fully detailed version of your JavaScript Workshop (Day 4 & Day 5) content, including deeper explanations, code examples, and implementation logic:


    ⭐ DAY 4: JavaScript Fundamentals + DOM + Async Concepts


    πŸ”Ή 1. BASIC SYNTAX

    Concepts Covered:

    • Variable declarations: var, let, const

    • Data types: String, Number, Boolean, Object, Array

    • Operators: +, -, ==, ===, &&, ||

    • Control statements: if, else, switch, for, while, do-while

    • Functions: named, anonymous, arrow

Example:

    // Declaring variables
    let name = "Keshav";
    const age = 22;

    // Function to greet
    function greet(userName) {
      return `Hello, ${userName}!`;
    }

    console.log(greet(name)); // Output: Hello, Keshav!

Implementation Logic:

  • let and const are block scoped (safer than var)

  • Functions allow reusable logic

  • Template literals (${}) make string handling easier


πŸ”Ή 2. DOM MANIPULATION

Concepts Covered:

  • getElementById, querySelector, innerText, innerHTML

  • Changing styles

  • Creating & removing elements

Example:

    <p id="message">Welcome!</p>
    <button onclick="updateMessage()">Click Me</button>

    <script>
      function updateMessage() {
        const msg = document.getElementById("message");
        msg.innerText = "Thanks for clicking!";
        msg.style.color = "green";
      }
    </script>

Implementation Logic:

  • DOM = document structure (HTML) controlled via JavaScript

  • We select elements and manipulate their properties or content


πŸ”Ή 3. FETCH API / AJAX

Concepts Covered:

  • Asynchronous network requests using fetch()

  • JSON parsing

  • Handling HTTP GET

Example:

    fetch('https://jsonplaceholder.typicode.com/users/1')
      .then(response => response.json())
      .then(data => {
        console.log(data.name); // Output: Leanne Graham
      })
      .catch(error => console.error("Error:", error));

Implementation Logic:

  • fetch() sends request and returns a Promise

  • .json() converts the response to a JavaScript object

  • Chaining .then() handles the result step-by-step


πŸ”Ή 4. ASYNC / AWAIT

Concepts Covered:

  • async functions

  • await pauses code until Promise resolves

Example:

    async function getUser() {
      try {
        const res = await fetch('https://jsonplaceholder.typicode.com/users/2');
        const user = await res.json();
        console.log(user.name);
      } catch (err) {
        console.error("Failed to fetch:", err);
      }
    }

    getUser();

Implementation Logic:

  • async makes a function return a Promise

  • await simplifies .then() chaining

  • Easier to read and debug asynchronous code


πŸ”Ή 5. EVENT LISTENERS

Concepts Covered:

  • addEventListener() method

  • Event types: click, mouseover, keydown, etc.

Example:

    <button id="btn">Click</button>
    <p id="result"></p>

    <script>
      document.getElementById("btn").addEventListener("click", function () {
        document.getElementById("result").innerText = "Button was clicked!";
      });
    </script>

Implementation Logic:

  • Event listeners wait for a user action

  • Can attach multiple listeners to the same element

  • Promotes separation of JS and HTML code


πŸ”Ή 6. ES6+ JAVASCRIPT

Concepts Covered:

  • Arrow functions

  • Destructuring

  • Template literals

  • Spread/rest operators

Example:

    // Arrow function
    const sum = (a, b) => a + b;

    // Destructuring
    let user = { name: "Keshav", age: 22 };
    let { name, age } = user;

    // Template literals
    console.log(`User ${name} is ${age} years old.`);

Implementation Logic:

  • ES6+ improves syntax and readability

  • Arrow functions are more concise

  • Destructuring makes object/array handling easier


⭐ DAY 5: Deep Dive Into JavaScript


πŸ”Ή 1. PROMISES

Concepts Covered:

  • Handling async tasks

  • resolve() and reject()

  • .then() and .catch()

Example:

    let isDone = true;

    let task = new Promise((resolve, reject) => {
      if (isDone) {
        resolve("Task completed!");
      } else {
        reject("Task failed!");
      }
    });

    task.then(msg => console.log(msg)).catch(err => console.error(err));

Implementation Logic:

  • Promises represent a future result (resolved or rejected)

  • Useful for operations like network calls or file reading


πŸ”Ή 2. CLASSES

Concepts Covered:

  • class keyword

  • constructor method

  • Object instantiation

Example:

    class Student {
      constructor(name, grade) {
        this.name = name;
        this.grade = grade;
      }

      getDetails() {
        return `${this.name} is in grade ${this.grade}`;
      }
    }

    let s1 = new Student("Riya", 10);
    console.log(s1.getDetails());

Implementation Logic:

  • Classes simplify object creation

  • this refers to the object instance


πŸ”Ή 3. ARRAY METHODS

Concepts Covered:

  • .map(), .filter(), .reduce(), .forEach()

Example:

    let numbers = [1, 2, 3, 4, 5];

    let squared = numbers.map(n => n * n); // [1, 4, 9, 16, 25]
    let evens = numbers.filter(n => n % 2 === 0); // [2, 4]
    let sum = numbers.reduce((total, num) => total + num, 0); // 15

Implementation Logic:

  • .map() transforms

  • .filter() selects

  • .reduce() accumulates


πŸ”Ή 4. SCOPING

Concepts Covered:

  • Global, function, and block scope

  • var vs let vs const

Example:

    function scopeTest() {
      let a = 10;
      if (true) {
        let b = 20;
        console.log(a); // βœ…
        console.log(b); // βœ…
      }
      console.log(b); // ❌ ReferenceError
    }

    scopeTest();

Implementation Logic:

  • let and const have block-level scope

  • var has function-level scope only


πŸ”Ή 5. HOISTING

Concepts Covered:

  • Function and variable hoisting

  • Only var is hoisted (initialized to undefined)

  • let and const are not hoisted the same way

Example:

    console.log(x); // undefined
    var x = 5;

    console.log(y); // ❌ ReferenceError
    let y = 10;

Implementation Logic:

  • During compile time, var declarations are moved to top but not their assignments

πŸ”Ή 6. CLOSURES

Concepts Covered:

  • Function inside function

  • Inner function retains access to outer function’s variables

Example:

    function outer() {
      let counter = 0;
      return function inner() {
        counter++;
        console.log(counter);
      };
    }

    let increment = outer();
    increment(); // 1
    increment(); // 2

Implementation Logic:

  • Even after outer() is done executing, inner() remembers counter

  • Great for data privacy and factory functions


βœ… Mini Project Ideas (Hands-on)

ProjectConcepts Used
To-Do AppDOM, Events, Arrays, LocalStorage (Optional)
Weather AppFetch API, Async/Await, DOM
Quiz AppEvent Listeners, Functions, DOM, Array Methods
Clock AppsetInterval, DOM, Functions
GitHub Profile FetcherFetch API, DOM, Async/Await

Would you like me to give you ready-made HTML + JS project files for any of these ideas or animations for each topic?