Web Development
79.1K subscribers
1.41K photos
1 video
2 files
754 links
Learn Web Development From Scratch

0️⃣ HTML / CSS
1️⃣ JavaScript
2️⃣ React / Vue / Angular
3️⃣ Node.js / Express
4️⃣ REST API
5️⃣ SQL / NoSQL Databases
6️⃣ UI / UX Design
7️⃣ Git / GitHub

Admin: @love_data
Download Telegram
This is useful when displaying product cards on different screen sizes.

7. Gap

The gap property adds spacing between flex items.

.container {
display: flex;
gap: 20px;
}


You can also define row and column gaps separately:

.container {
display: flex;
row-gap: 10px;
column-gap: 20px;
flex-wrap: wrap;
}


8. Flex Grow

flex-grow determines how much an item can grow relative to other flex items when extra space is available.

.box1 {
flex-grow: 1;
}

.box2 {
flex-grow: 2;
}


Box 2 receives twice as much of the available extra space as Box 1.

9. Flex Shrink

flex-shrink controls how much an item shrinks when there isn't enough space.

.box1 {
flex-shrink: 1;
}

.box2 {
flex-shrink: 0;
}


• 1 = Can shrink.

• 0 = Will not shrink due to the flex-shrink calculation.

10. Flex Basis

flex-basis defines an item's initial main size before remaining space is distributed.

.box {
flex-basis: 200px;
}


It is similar to setting an initial width in a row layout or height in a column layout.

11. Flex Shorthand

You can combine three properties into one:

.box {
flex: 1 1 200px;
}


The order is:

flex: grow shrink basis;

For example:

.box {
flex: 1;
}


This is a common shorthand that allows an item to grow and shrink, with a zero-percent flex basis.

12. Align Self

align-self allows you to override the alignment of an individual flex item.

.box2 {
align-self: flex-end;
}


Other values include:

• auto

• flex-start

• flex-end

• center

• baseline

• stretch

13. Real-World Example: Navigation Bar

HTML:

<nav class="navbar">
<h2>MyWebsite</h2>

<div class="links">
<a href="#">Home</a>
<a href="#">About</a>
<a href="#">Services</a>
<a href="#">Contact</a>
</div>
</nav>


CSS:

.navbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 30px;
background-color: navy;
color: white;
}

.links {
display: flex;
gap: 20px;
}

.links a {
color: white;
text-decoration: none;
}


This creates a navigation bar where the website name appears on the left and navigation links appear on the right.

Key Takeaways

• Flexbox makes website layouts easier to build.

• The parent is called the flex container.

• Its direct children are flex items.

• justify-content controls the main axis.

• align-items controls the cross axis.

• flex-wrap helps items move onto multiple lines.

Double Tap ❤️ For Part-35
❤5🔥1🤔1
𝗧𝗢𝗣 𝟱 𝗣𝗟𝗔𝗧𝗙𝗢𝗥𝗠𝗦 𝗧𝗢 𝗙𝗜𝗡𝗗 𝗛𝗜𝗚𝗛-𝗣𝗔𝗬𝗜𝗡𝗚 𝗥𝗘𝗠𝗢𝗧𝗘 𝗧𝗘𝗖𝗛 𝗝𝗢𝗕𝗦!

Explore 5 platforms to discover remote opportunities in:

💻 Software Development
📊 Data Analytics
🤖 AI & Machine Learning
☁️ Cloud Computing
🔐 Cybersecurity

✅ Work-From-Home Opportunities
✅ Explore Global Tech Companies
✅ Find Jobs Matching Your Skills

🔗 𝗟𝗶𝗻𝗸 👇:-

https://pdlink.in/4C6fqci

📌 SAVE & SHARE with friends looking for remote jobs! 🔥
❤4
𝗙𝗥𝗘𝗘 𝗢𝗻𝗹𝗶𝗻𝗲 𝗠𝗮𝘀𝘁𝗲𝗿𝗰𝗹𝗮𝘀𝘀 𝗢𝗻 𝗔𝗜 | 𝗕𝘂𝗶𝗹𝗱 𝗔𝗜-𝗡𝗮𝘁𝗶𝘃𝗲 𝗧𝗲𝗰𝗵 𝗖𝗮𝗿𝗲𝗲𝗿😍

- Get Exclusive 90-Day MAANG Career Roadmap

- Identify Which AI-Era Roles Companies Are Hiring For Now

🎓Eligibility :- Students ,Freshers & Working Professionals

𝗥𝗲𝗴𝗶𝘀𝘁𝗲𝗿 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘👇 :-

https://pdlink.in/4zQvjC2

Date:- 21st Nov 2026 Time:- 5:00 PM (IST)
❤1
🌐 Web Development Roadmap, Part 35

CSS Grid, Building Two-Dimensional Layouts

CSS Grid is a powerful CSS layout system used to create rows and columns on a webpage.

While Flexbox is mainly designed for one-dimensional layouts (row or column), CSS Grid handles two-dimensional layouts (rows and columns together).

CSS Grid is commonly used for:

• Website layouts

• Image galleries

• Product grids

• Dashboards

• Card layouts

• Responsive web pages

1. What Is CSS Grid?

CSS Grid allows you to divide a webpage into rows and columns and position elements inside that structure.

To activate Grid, use:

.container {
display: grid;
}


Example:

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


.container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}


This creates two equal-width columns.

2. Grid Container and Grid Items

CSS Grid has two important concepts.

Grid Container: The parent element with display: grid.

Grid Items: The direct children inside the grid container.

       Grid Container
┌─────────────┬─────────────┐
│ Box 1 │ Box 2 │
├─────────────┼─────────────┤
│ Box 3 │ Box 4 │
└─────────────┴─────────────┘
Grid Items


3. grid-template-columns

The grid-template-columns property defines the number and size of columns.

.container {
display: grid;
grid-template-columns: 200px 200px;
}


This creates two columns, each 200px wide.

You can also use fractional units:

.container {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
}


This creates three equal-width columns.

Another example:

.container {
display: grid;
grid-template-columns: 2fr 1fr;
}


The first column receives twice the available space of the second column.

4. grid-template-rows

The grid-template-rows property defines the height of rows.

.container {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 100px 200px;
}


This creates:

• First row: 100px high

• Second row: 200px high

5. The Gap Property

The gap property adds space between grid rows and columns.

.container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
}


You can also control spacing separately:

.container {
row-gap: 20px;
column-gap: 30px;
}


6. grid-template-areas

Grid areas allow you to name different sections of a layout.

.container {
display: grid;
grid-template-areas:
"header header"
"sidebar main"
"footer footer";

grid-template-columns: 200px 1fr;
gap: 10px;
}

.header {
grid-area: header;
}

.sidebar {
grid-area: sidebar;
}

.main {
grid-area: main;
}

.footer {
grid-area: footer;
}


Visual structure:

┌──────────────────────┐
│ HEADER │
├─────────┬────────────┤
│ SIDEBAR │ MAIN │
├─────────┴────────────┤
│ FOOTER │
└──────────────────────┘


This is useful for creating complete website layouts.

7. Grid Column and Row Spanning

You can make an element occupy multiple columns or rows.

Column spanning:

.item1 {
grid-column: span 2;
}


This makes the item occupy two columns.

Row spanning:

.item2 {
grid-row: span 2;
}
❤1
This makes the item occupy two rows.

8. repeat() Function

The repeat() function reduces repetitive CSS.

Instead of writing:

.container {
grid-template-columns: 1fr 1fr 1fr;
}


You can write:

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


Both create three equal-width columns.

9. minmax() Function

The minmax() function defines a minimum and maximum size for a grid track.

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


Each column has a minimum size of 150px and can grow to share available space.

10. auto-fit and auto-fill

These keywords help create flexible grid layouts.

.container {
display: grid;
grid-template-columns:
repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
}


• auto-fit fits columns into available space and can expand existing columns.

• auto-fill creates as many tracks as fit, preserving empty tracks when space allows.

These are especially useful for responsive card layouts.

11. Real-World Example: Product Grid

HTML:

<div class="products">
<div class="card">Laptop</div>
<div class="card">Mobile</div>
<div class="card">Headphones</div>
<div class="card">Keyboard</div>
</div>


CSS:

.products {
display: grid;
grid-template-columns:
repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
}

.card {
padding: 30px;
background-color: lightblue;
border-radius: 10px;
text-align: center;
}


This creates a responsive product grid that adjusts the number of columns based on available space.

12. Flexbox vs CSS Grid
❤2
13. Quick Revision
Key Takeaways

• CSS Grid creates two-dimensional layouts.

• Use grid-template-columns to define columns.

• Use grid-template-rows to define rows.

• Use gap to create spacing.

• Use grid-template-areas for structured website layouts.

• Use repeat() and minmax() for flexible sizing.

• Use auto-fit to create responsive card layouts.

Double Tap ❤️ For More
❤5👍1
𝗙𝗥𝗘𝗘 𝗟𝗘𝗔𝗥𝗡𝗜𝗡𝗚 𝗔𝗡𝗗 𝗖𝗘𝗥𝗧𝗜𝗙𝗜𝗖𝗔𝗧𝗜𝗢𝗡 𝗥𝗘𝗦𝗢𝗨𝗥𝗖𝗘𝗦 𝗧𝗢 𝗕𝗨𝗜𝗟𝗗 𝗬𝗢𝗨𝗥 𝗖𝗢𝗗𝗜𝗡𝗚 𝗦𝗞𝗜𝗟𝗟𝗦😍

Explore free courses and resources to learn:

✅ Beginner-Friendly Resources
✅ Self-Paced Learning
✅ Build Practical Coding Skills
✅ Explore Certification Opportunities

🎯 Perfect for Students, Freshers & Aspiring Developers!

𝗟𝗶𝗻𝗸👇:-

https://pdlink.in/4fbyA6I

📌 SAVE & SHARE with friends looking for FREE courses🔥
❤1
✅ 20 Medium-Level Web Development Interview Questions (with Detailed Answers)

1. What is the difference between HTML, CSS, and JavaScript
• HTML: Structures content
• CSS: Styles content
• JavaScript: Adds interactivity and dynamic behavior

2. What is responsive web design
Designing websites that adapt to different screen sizes and devices using flexible grids, media queries, and fluid layouts.

3. What are semantic HTML elements
Elements that clearly describe their meaning (e.g., <article>, <section>, <nav>, <header>). Improves accessibility and SEO.

4. What is the DOM
Document Object Model — a tree-like structure representing HTML elements. JavaScript can manipulate it to update content dynamically.

5. What is the difference between GET and POST methods
• GET: Sends data via URL, used for fetching
• POST: Sends data in body, used for submitting forms securely

6. What is the box model in CSS
Every HTML element is a box:
Content → Padding → Border → Margin

7. What is the difference between relative, absolute, and fixed positioning in CSS
• Relative: Moves element relative to its normal position
• Absolute: Positions element relative to nearest positioned ancestor
• Fixed: Stays in place even when scrolling

8. What is the difference between == and === in JavaScript
• ==: Compares values with type coercion
• ===: Strict comparison (value and type)

9. What is event bubbling in JavaScript
Events propagate from child to parent elements. Can be controlled using stopPropagation().

10. What is the difference between localStorage and sessionStorage
• localStorage: Persistent across sessions
• sessionStorage: Cleared when tab is closed

11. What is a RESTful API
An architectural style for designing networked applications using HTTP methods (GET, POST, PUT, DELETE) and stateless communication.

12. What is the difference between frontend and backend development
• Frontend: Client-side (UI/UX, HTML/CSS/JS)
• Backend: Server-side (databases, APIs, authentication)

13. What are common HTTP status codes
• 200 OK
• 404 Not Found
• 500 Internal Server Error
• 403 Forbidden
• 301 Moved Permanently

14. What is a promise in JavaScript
An object representing the eventual completion or failure of an async operation.
States: pending, fulfilled, rejected

15. What is the difference between synchronous and asynchronous code
• Synchronous: Executes line by line
• Asynchronous: Executes independently, doesn’t block the main thread

16. What is a CSS preprocessor
Tools like SASS or LESS that add features to CSS (variables, nesting, mixins) and compile into standard CSS.

17. What is the role of frameworks like React, Angular, or Vue
They simplify building complex UIs with reusable components, state management, and routing.

18. What is the difference between SQL and NoSQL databases
• SQL: Structured, relational (e.g., MySQL)
• NoSQL: Flexible schema, document-based (e.g., MongoDB)

19. What is version control and why is Git important
Version control tracks changes in code. Git allows collaboration, branching, and rollback. Platforms: GitHub, GitLab, Bitbucket

20. How do you optimize website performance
• Minify CSS/JS
• Use lazy loading
• Compress images
• Use CDN
• Reduce HTTP requests

👍 React for more Interview Resources
❤9👍1
𝗙𝗥𝗘𝗘 𝗠𝗮𝘀𝘁𝗲𝗿𝗰𝗹𝗮𝘀𝘀 𝗢𝗻 𝗟𝗮𝘁𝗲𝘀𝘁 𝗧𝗲𝗰𝗵𝗻𝗼𝗹𝗼𝗴𝗶𝗲𝘀 😍

Get the 90-Day Plan to Build 1% Tech Career

- AI
- GenAI
- Data Analytics
- Fullstack
- UI/UX

Use Coupon Code " 𝗛𝗖𝗟𝗚𝗨𝗩𝗜𝟭𝟬𝟬 " To Register For FREE

𝗥𝗲𝗴𝗶𝘀𝘁𝗲𝗿 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘👇 :-

https://pdlink.in/4fFMe22

Date:- 21st Nov 2026 Time:- 5:00 PM (IST)
🌐 Web Development Roadmap: Part 36

CSS Pseudo-Classes (:hover, :focus, :active, :first-child & :nth-child)

CSS pseudo-classes allow you to style HTML elements based on their state, position, or interaction with users.

For example:

• Change a button's color when someone hovers over it.

• Highlight an input field when someone clicks it.

• Style the first item in a list differently.

• Apply different styles to even and odd rows in a table.

Let's understand the important pseudo-classes.

1. What Is a Pseudo-Class?

A pseudo-class is a keyword added to a CSS selector using a colon (:).

Syntax:

selector:pseudo-class {
property: value;
}


Example:

button:hover {
background-color: blue;
}


When the user moves the mouse over the button, its background becomes blue.

2. :hover

The :hover pseudo-class applies styles when the user points to an element with a mouse or another pointing device.

<button>Click Me</button>


button {
background-color: blue;
color: white;
padding: 12px 20px;
}

button:hover {
background-color: darkblue;
}


Real-world usage:

• Buttons

• Navigation links

• Product cards

• Image galleries

3. :active

The :active pseudo-class applies styles while an element is being activated, such as while a mouse button is held down on it.

button:active {
background-color: red;
transform: scale(0.95);
}


This makes the button slightly smaller while being pressed.

4. :focus

The :focus pseudo-class applies styles when an element receives focus.

For example, when a user clicks an input field or navigates to it using the keyboard.

<input type="text" placeholder="Enter your name">


input:focus {
border: 2px solid blue;
outline: none;
}


This highlights the input field when it receives focus.

Real-world usage: Login forms, search boxes, registration forms.

Note: Always provide a visible focus indicator so keyboard users can identify the currently focused element.

5. :first-child

Selects an element if it is the first child of its parent.

HTML:

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


CSS:

li:first-child {
color: red;
}


Only HTML becomes red.

6. :last-child

Selects an element if it is the last child of its parent.

li:last-child {
color: green;
}


Only JavaScript becomes green.

7. :nth-child()

The :nth-child() pseudo-class selects an element based on its position among its siblings.

li:nth-child(2) {
color: blue;
}


This selects the second child.

You can also select multiple positions.

Every second element:

li:nth-child(even) {
background-color: lightgray;
}


Odd-numbered elements:

li:nth-child(odd) {
background-color: lightblue;
}


Every third element:

li:nth-child(3n) {
color: red;
}


This selects the 3rd, 6th, 9th and subsequent multiples of three.

8. :checked

The :checked pseudo-class selects checked checkboxes and selected radio buttons.

<input type="checkbox" id="terms">
<label for="terms">Accept Terms</label>


input:checked {
accent-color: green;
}
❤1
This changes the checkbox's accent color when selected.

9. :disabled and :enabled

These pseudo-classes select form elements based on whether they are disabled or enabled.

input:disabled {
background-color: lightgray;
}

input:enabled {
border: 1px solid green;
}


Useful for forms where some fields are unavailable until certain conditions are met.

10. :not()

The :not() pseudo-class selects elements that do not match a particular selector.

p:not(.special) {
color: gray;
}


This selects all paragraphs except those with the special class.

11. :first-of-type and :last-of-type

These select the first or last occurrence of a particular element type among its siblings.

p:first-of-type {
color: blue;
}

p:last-of-type {
color: red;
}


Difference:

• :first-child checks whether an element is the first child of its parent.

• :first-of-type checks whether it is the first element of its type among siblings.

12. Real-World Example: Interactive Navigation Menu

<nav class="navbar">
<a href="#">Home</a>
<a href="#">About</a>
<a href="#">Services</a>
<a href="#">Contact</a>
</nav>


```css
.navbar a {
text-decoration: none;
color: black;
padding: 12px 20px;
}

.navbar a:hover {
color: white;
background-color: blue;
}

.navbar a:active {
background-color: darkblue;
}

.navbar a:focus-visible {
outline: 2px solid orange;
}`


This creates an interactive navigation menu with hover, active, and keyboard-focus effects.

13. Quick Revision

• :hover: When pointing over an element

• :active: While activating an element

• :focus: When an element receives focus

• :focus-visible: Shows focus styling when appropriate, commonly keyboard navigation

• :first-child: Selects the first child

• :last-child: Selects the last child

• :nth-child(): Selects based on sibling position

• :checked: Selects checked inputs

• :disabled: Selects disabled elements

• :enabled: Selects enabled elements

• :not(): Excludes matching elements

• :first-of-type: Selects the first of its element type

• :last-of-type: Selects the last of its element type

Key Takeaways

• Pseudo-classes help make websites interactive.

• :hover is useful for buttons and links.

• :focus improves form interaction and accessibility.

• :nth-child() helps style specific list items and table rows.

• :checked is useful for checkboxes and radio buttons.

• :not() helps exclude specific elements from styling.

Double Tap ❤️ For More
❤5
𝗕𝗢𝗢𝗦𝗧 𝗬𝗢𝗨𝗥 𝗥𝗘𝗦𝗨𝗠𝗘 𝗪𝗜𝗧𝗛 𝟰 𝗙𝗥𝗘𝗘 𝗜𝗡-𝗗𝗘𝗠𝗔𝗡𝗗 𝗖𝗢𝗨𝗥𝗦𝗘𝗦! 🎓

😍 Want to learn high-demand tech skills without spending ₹1?

📊 Data Analytics
💻 Full Stack Development
🤖 AI & Generative AI
☁️ Cloud Computing

🎯Perfect for Students, Freshers & Job Seekers!

𝗟𝗶𝗻𝗸👇:-

https://pdlink.in/4jsqetS

📌 SAVE & SHARE with friends looking for FREE courses🔥