🌐 Web Development Roadmap: Part 32
CSS Borders, Border Radius, Outline & Box Shadow
These CSS properties help you improve the appearance of webpage elements by adding borders, rounded corners, outlines, and shadows.
Let's understand each one.
1. CSS Border
The border property adds a visible line around an HTML element.
A border has three main components:
• Width, Thickness of the border.
• Style, Appearance of the border.
• Color, Border color.
You can also define them separately:
Common border styles:
2. Individual Border Properties
You can apply borders to specific sides of an element.
This gives each side a different border.
You can also use:
This adds a border only to the bottom.
3. Border Radius
The border-radius property creates rounded corners.
Common examples:
You can also round individual corners:
4. CSS Outline
An outline is a line drawn outside an element's border.
Border vs Outline:
CSS Borders, Border Radius, Outline & Box Shadow
These CSS properties help you improve the appearance of webpage elements by adding borders, rounded corners, outlines, and shadows.
Let's understand each one.
1. CSS Border
The border property adds a visible line around an HTML element.
.box {
border: 2px solid black;
}A border has three main components:
• Width, Thickness of the border.
• Style, Appearance of the border.
• Color, Border color.
You can also define them separately:
.box {
border-width: 2px;
border-style: solid;
border-color: blue;
}Common border styles:
border-style: solid;
border-style: dashed;
border-style: dotted;
border-style: double;
border-style: groove;
border-style: ridge;
border-style: none;
2. Individual Border Properties
You can apply borders to specific sides of an element.
.box {
border-top: 2px solid red;
border-right: 2px solid blue;
border-bottom: 2px solid green;
border-left: 2px solid orange;
}This gives each side a different border.
You can also use:
.box {
border-bottom: 3px solid black;
}This adds a border only to the bottom.
3. Border Radius
The border-radius property creates rounded corners.
.box {
border: 2px solid black;
border-radius: 10px;
}Common examples:
/* Slightly rounded */
.box1 {
border-radius: 5px;
}
/* More rounded */
.box2 {
border-radius: 20px;
}
/* Circular shape for a square element */
.box3 {
border-radius: 50%;
}
You can also round individual corners:
.box {
border-top-left-radius: 10px;
border-top-right-radius: 20px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 15px;
}4. CSS Outline
An outline is a line drawn outside an element's border.
.box {
border: 2px solid black;
outline: 3px solid red;
}Border vs Outline:
❤1
Outlines are especially useful for keyboard focus indicators.
Example:
This makes the focused input easier to identify.
5. CSS Box Shadow
The box-shadow property adds a shadow around an element.
The basic syntax:
Understanding the values:
• Horizontal, Moves the shadow left or right.
• Vertical, Moves the shadow up or down.
• Blur, Controls how blurry the shadow appears.
• Spread, Controls the shadow's size.
• Color, Defines the shadow color.
6. Inset Box Shadow
An inset shadow appears inside the element rather than outside it.
This can create an inner-depth effect.
7. Multiple Shadows
You can apply more than one shadow to an element.
This creates a layered shadow effect.
8. Real-World Example: Modern Product Card
HTML:
CSS:
This creates a clean product card with rounded corners and a subtle shadow.
Double Tap ❤️ For More
Example:
input:focus {
outline: 2px solid blue;
}This makes the focused input easier to identify.
5. CSS Box Shadow
The box-shadow property adds a shadow around an element.
.card {
width: 250px;
padding: 20px;
background-color: white;
box-shadow: 5px 5px 10px gray;
}The basic syntax:
box-shadow: horizontal vertical blur spread color;Understanding the values:
• Horizontal, Moves the shadow left or right.
• Vertical, Moves the shadow up or down.
• Blur, Controls how blurry the shadow appears.
• Spread, Controls the shadow's size.
• Color, Defines the shadow color.
.card {
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);
}6. Inset Box Shadow
An inset shadow appears inside the element rather than outside it.
.box {
box-shadow: inset 0 0 10px gray;
}This can create an inner-depth effect.
7. Multiple Shadows
You can apply more than one shadow to an element.
.card {
box-shadow:
0 4px 8px rgba(0, 0, 0, 0.15),
0 10px 20px rgba(0, 0, 0, 0.10);
}This creates a layered shadow effect.
8. Real-World Example: Modern Product Card
HTML:
<div class="product-card">
<h2>Wireless Headphones</h2>
<p>Price: ₹2,499</p>
<button>Buy Now</button>
</div>
CSS:
.product-card {
width: 300px;
padding: 20px;
border: 1px solid #ddd;
border-radius: 12px;
background-color: white;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
button {
padding: 10px 20px;
border: none;
border-radius: 6px;
background-color: blue;
color: white;
cursor: pointer;
}This creates a clean product card with rounded corners and a subtle shadow.
Double Tap ❤️ For More
❤3👏1
𝟯 𝗙𝗥𝗘𝗘 𝗛𝘂𝗯𝗦𝗽𝗼𝘁 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻𝘀 𝗳𝗼𝗿 𝗦𝘁𝘂𝗱𝗲𝗻𝘁𝘀 & 𝗙𝗿𝗲𝘀𝗵𝗲𝗿𝘀 𝗶𝗻 𝟮𝟬𝟮𝟲🎓
💫HubSpot Academy offers three free online certifications that match these interests.
💫Pick one free course and try it out on your next college event and the certification is free.
🔗 𝗟𝗶𝗻𝗸 :- 👇
https://pdlink.in/4iM5xaQ
📲 *Save & Share with your friends! 🔥*
💫HubSpot Academy offers three free online certifications that match these interests.
💫Pick one free course and try it out on your next college event and the certification is free.
🔗 𝗟𝗶𝗻𝗸 :- 👇
https://pdlink.in/4iM5xaQ
📲 *Save & Share with your friends! 🔥*
𝗙𝗥𝗘𝗘 𝗥𝗲𝘀𝗼𝘂𝗿𝗰𝗲𝘀 𝗧𝗼 𝗚𝗲𝘁 𝗬𝗼𝘂𝗿 𝗗𝗿𝗲𝗮𝗺 𝗝𝗼𝗯 𝗜𝗡 𝗚𝗼𝗼𝗴𝗹𝗲🔥
Discover *4 FREE resources* to help you prepare for a career at Google!
✅ Improve Your Coding Skills
✅ Strengthen Interview Preparation
✅ Build Technical Knowledge
✅ Prepare for Top Tech Opportunities
🎓Perfect for Students, Freshers & Aspiring Software Engineers!
🔗 𝗟𝗶𝗻𝗸 👇:-
https://pdlink.in/4AwRPQy
📲 SAVE & SHARE with friends dreaming of working at Google!
Discover *4 FREE resources* to help you prepare for a career at Google!
✅ Improve Your Coding Skills
✅ Strengthen Interview Preparation
✅ Build Technical Knowledge
✅ Prepare for Top Tech Opportunities
🎓Perfect for Students, Freshers & Aspiring Software Engineers!
🔗 𝗟𝗶𝗻𝗸 👇:-
https://pdlink.in/4AwRPQy
📲 SAVE & SHARE with friends dreaming of working at Google!
❤1
𝗙𝗥𝗘𝗘 𝗩𝗜𝗥𝗧𝗨𝗔𝗟 𝗜𝗡𝗧𝗘𝗥𝗡𝗦𝗛𝗜𝗣𝗦 𝗪𝗜𝗧𝗛 𝗧𝗢𝗣 𝗖𝗢𝗠𝗣𝗔𝗡𝗜𝗘𝗦! 🎓
💻 Explore FREE Virtual Internship & Job Simulation Programs from leading companies!
✅ Learn Industry-Relevant Skills
✅ Work on Practical Tasks
✅ Self-Paced Online Learning
✅ Explore Completion Certificates
✅ Strengthen Your Resume & LinkedIn Profile
🎯 Perfect for Students, Freshers & Job Seekers
🔗 𝗟𝗶𝗻𝗸 👇:-
https://pdlink.in/4t8DRlq
📲 SAVE & SHARE with friends looking for career opportunities!
💻 Explore FREE Virtual Internship & Job Simulation Programs from leading companies!
✅ Learn Industry-Relevant Skills
✅ Work on Practical Tasks
✅ Self-Paced Online Learning
✅ Explore Completion Certificates
✅ Strengthen Your Resume & LinkedIn Profile
🎯 Perfect for Students, Freshers & Job Seekers
🔗 𝗟𝗶𝗻𝗸 👇:-
https://pdlink.in/4t8DRlq
📲 SAVE & SHARE with friends looking for career opportunities!
❤1
𝟰 𝗙𝗥𝗘𝗘 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 𝗧𝗼 𝗠𝗮𝘀𝘁𝗲𝗿 𝗘𝘅𝗰𝗲𝗹 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘 📊
🎓 Explore 4 FREE Excel Courses to upgrade your skills!
✅ Excel Formulas & Functions
✅ Pivot Tables & Charts
✅ Data Cleaning & Analysis
✅ Dashboards & Reporting
🎯 Perfect for Students, Freshers & Aspiring Data Analysts!
🔗 𝗟𝗶𝗻𝗸 👇:-
https://pdlink.in/48mO4B2
📌 SAVE & SHARE with friends who want to master Excel! 🔥
🎓 Explore 4 FREE Excel Courses to upgrade your skills!
✅ Excel Formulas & Functions
✅ Pivot Tables & Charts
✅ Data Cleaning & Analysis
✅ Dashboards & Reporting
🎯 Perfect for Students, Freshers & Aspiring Data Analysts!
🔗 𝗟𝗶𝗻𝗸 👇:-
https://pdlink.in/48mO4B2
📌 SAVE & SHARE with friends who want to master Excel! 🔥
🌐 Web Development Roadmap: Part 33
CSS Positioning (Static, Relative, Absolute, Fixed & Sticky)
CSS positioning controls where an HTML element appears on a webpage.
It allows you to place elements in specific locations, overlap elements, create floating buttons, and build sticky navigation bars.
There are five important CSS position values:
•
•
•
•
•
1. Position: Static
Elements appear in the normal document flow.
Important points:
• Elements follow the normal page layout.
• They appear one after another according to the document structure.
•
2. Position: Relative
What happens?
• The element moves 20px down.
• The element moves 30px to the right.
• Its original space in the document flow remains reserved.
Real-world use: Making small adjustments to an element or creating a positioning reference for an absolutely positioned child.
3. Position: Absolute
A positioned ancestor means an ancestor whose position is not
Example:
Here:
• The parent acts as the positioning reference.
• The child appears 10px from the parent's top and right edges.
• The child is removed from the normal document flow.
Real-world use: Badges on product images, notification labels, and icons inside input fields.
4. Position: Fixed
It generally stays in the same position even when the user scrolls the webpage.
Real-world use:
• Floating chat buttons
• Back-to-top buttons
• Fixed action buttons
5. Position: Sticky
The element behaves normally until it reaches a specified scroll position, then sticks within its scrolling container.
Here, the navigation bar sticks to the top when the page is scrolled to it.
Common uses:
• Sticky navigation bars
• Table headers
• Section headings
6. Understanding Top, Right, Bottom & Left
These properties control the position of an element when used with a positioning mode that supports offsets.
CSS Positioning (Static, Relative, Absolute, Fixed & Sticky)
CSS positioning controls where an HTML element appears on a webpage.
It allows you to place elements in specific locations, overlap elements, create floating buttons, and build sticky navigation bars.
There are five important CSS position values:
•
static•
relative•
absolute•
fixed•
sticky1. Position: Static
static is the default positioning behavior of HTML elements.Elements appear in the normal document flow.
.box {
position: static;
}Important points:
• Elements follow the normal page layout.
• They appear one after another according to the document structure.
•
top, right, bottom, and left do not reposition a static element.2. Position: Relative
relative positions an element relative to its original position.<div class="box">Hello World</div>
.box {
position: relative;
top: 20px;
left: 30px;
}What happens?
• The element moves 20px down.
• The element moves 30px to the right.
• Its original space in the document flow remains reserved.
Real-world use: Making small adjustments to an element or creating a positioning reference for an absolutely positioned child.
3. Position: Absolute
absolute positions an element relative to its nearest positioned ancestor.A positioned ancestor means an ancestor whose position is not
static.Example:
<div class="parent">
<div class="child">Hello</div>
</div>
.parent {
position: relative;
width: 300px;
height: 200px;
background-color: lightblue;
}
.child {
position: absolute;
top: 10px;
right: 10px;
background-color: orange;
}Here:
• The parent acts as the positioning reference.
• The child appears 10px from the parent's top and right edges.
• The child is removed from the normal document flow.
Real-world use: Badges on product images, notification labels, and icons inside input fields.
4. Position: Fixed
fixed positions an element relative to the viewport.It generally stays in the same position even when the user scrolls the webpage.
.chat-button {
position: fixed;
bottom: 20px;
right: 20px;
background-color: blue;
color: white;
padding: 15px;
}Real-world use:
• Floating chat buttons
• Back-to-top buttons
• Fixed action buttons
5. Position: Sticky
sticky combines normal document flow with fixed-like behavior.The element behaves normally until it reaches a specified scroll position, then sticks within its scrolling container.
nav {
position: sticky;
top: 0;
background-color: navy;
color: white;
}Here, the navigation bar sticks to the top when the page is scrolled to it.
Common uses:
• Sticky navigation bars
• Table headers
• Section headings
6. Understanding Top, Right, Bottom & Left
These properties control the position of an element when used with a positioning mode that supports offsets.
.box {
position: absolute;
top: 20px;
right: 30px;
bottom: 10px;
left: 40px;
}❤3
• top: Distance from the top
• right: Distance from the right
• bottom: Distance from the bottom
• left: Distance from the left
7. What Is Z-Index?
controls the stacking order of overlapping elements.
An element with a higher stacking level generally appears in front of one with a lower stacking level, when they belong to the same stacking context.
Here, Box 2 appears in front of Box 1 where they overlap.
8. CSS Position Comparison
• static: Normal document flow
• relative: Moves relative to original position
• absolute: Positioned relative to nearest positioned ancestor
• fixed: Positioned relative to viewport
• sticky: Sticks after reaching a scroll threshold
9. Real-World Example: Product Image Badge
HTML:
CSS:
The SALE badge appears in the top-right corner of the product image.
Double Tap ❤️ For More
• right: Distance from the right
• bottom: Distance from the bottom
• left: Distance from the left
7. What Is Z-Index?
z-index
controls the stacking order of overlapping elements.
An element with a higher stacking level generally appears in front of one with a lower stacking level, when they belong to the same stacking context.
<div class="box box1">Box 1</div>
<div class="box box2">Box 2</div>
.box {
position: absolute;
width: 150px;
height: 150px;
}
.box1 {
background-color: blue;
z-index: 1;
}
.box2 {
background-color: red;
left: 50px;
top: 50px;
z-index: 2;
}Here, Box 2 appears in front of Box 1 where they overlap.
8. CSS Position Comparison
• static: Normal document flow
• relative: Moves relative to original position
• absolute: Positioned relative to nearest positioned ancestor
• fixed: Positioned relative to viewport
• sticky: Sticks after reaching a scroll threshold
9. Real-World Example: Product Image Badge
HTML:
<div class="product">
<span class="badge">SALE</span>
<img src="product.jpg" alt="Product">
<h2>Wireless Headphones</h2>
<p>Price: ₹2,499</p>
</div>
CSS:
.product {
position: relative;
width: 300px;
}
.product img {
width: 100%;
}
.badge {
position: absolute;
top: 10px;
right: 10px;
background-color: red;
color: white;
padding: 8px 12px;
border-radius: 5px;
}The SALE badge appears in the top-right corner of the product image.
Double Tap ❤️ For More
❤10
𝗠𝗜𝗖𝗥𝗢𝗦𝗢𝗙𝗧 𝗣𝗢𝗪𝗘𝗥 𝗕𝗜 – 𝗙𝗥𝗘𝗘 𝗖𝗢𝗨𝗥𝗦𝗘! 📊
😍 Want to master Power BI & Data Analytics without spending ₹1?
🎓 Explore Microsoft's FREE Power BI learning resources!
✅ Data Visualization & Dashboards
✅ Power Query & Data Cleaning
✅ DAX Formulas & Data Modeling
✅ Business Intelligence Skills
🎯 Perfect for Students, Freshers & Aspiring Data Analysts!
🔗 𝗟𝗶𝗻𝗸 👇:-
https://pdlink.in/4t3Jl0E
📌 SAVE & SHARE with friends interested in Data Analytics! 🔥
😍 Want to master Power BI & Data Analytics without spending ₹1?
🎓 Explore Microsoft's FREE Power BI learning resources!
✅ Data Visualization & Dashboards
✅ Power Query & Data Cleaning
✅ DAX Formulas & Data Modeling
✅ Business Intelligence Skills
🎯 Perfect for Students, Freshers & Aspiring Data Analysts!
🔗 𝗟𝗶𝗻𝗸 👇:-
https://pdlink.in/4t3Jl0E
📌 SAVE & SHARE with friends interested in Data Analytics! 🔥
❤1
🌐 Web Development Roadmap : Part 34
CSS Flexbox : Building Flexible Website Layouts
CSS Flexbox (Flexible Box Layout) is a CSS layout system used to arrange elements inside a container.
It makes it easier to align, distribute, and organize elements horizontally or vertically.
Flexbox is especially useful for:
• Navigation bars
• Website headers
• Product cards
• Buttons
• Centering content
• Responsive layouts
1. What Is Flexbox?
To use Flexbox, apply
Example:
CSS:
The boxes will appear next to each other in a row.
2. Flex Container and Flex Items
Flexbox has two important concepts:
Flex Container: The parent element with
Flex Items: The direct child elements inside the flex container.
3. Flex Direction
The
Common values:
A. row
Arranges items horizontally from left to right.
B. row-reverse
Arranges items horizontally in reverse order.
C. column
Arranges items vertically from top to bottom.
D. column-reverse
Arranges items vertically in reverse order.
4. Justify Content
The
Important values:
• flex-start: Items at the beginning
• flex-end: Items at the end
• center: Items in the center
• space-between: Equal space between items
• space-around: Space around each item
• space-evenly: Equal spacing between and around items
This distributes items with equal space between them.
5. Align Items
The
•
•
•
•
•
Remember:
•
•
The main axis depends on the
6. Flex Wrap
By default, flex items try to fit on one line.
The
CSS Flexbox : Building Flexible Website Layouts
CSS Flexbox (Flexible Box Layout) is a CSS layout system used to arrange elements inside a container.
It makes it easier to align, distribute, and organize elements horizontally or vertically.
Flexbox is especially useful for:
• Navigation bars
• Website headers
• Product cards
• Buttons
• Centering content
• Responsive layouts
1. What Is Flexbox?
To use Flexbox, apply
display: flex to a parent element.Example:
<div class="container">
<div class="box">Box 1</div>
<div class="box">Box 2</div>
<div class="box">Box 3</div>
</div>
CSS:
.container {
display: flex;
}
.box {
background-color: lightblue;
padding: 20px;
margin: 10px;
}The boxes will appear next to each other in a row.
2. Flex Container and Flex Items
Flexbox has two important concepts:
Flex Container: The parent element with
display: flex.Flex Items: The direct child elements inside the flex container.
Flex Container
┌─────────────────────┐
│ │
│ Box 1 Box 2 Box 3 │
│ │
└─────────────────────┘
↑ ↑ ↑
Flex Items
3. Flex Direction
The
flex-direction property controls the direction of flex items..container {
display: flex;
flex-direction: row;
}Common values:
A. row
Arranges items horizontally from left to right.
flex-direction: row;
B. row-reverse
Arranges items horizontally in reverse order.
flex-direction: row-reverse;
C. column
Arranges items vertically from top to bottom.
flex-direction: column;
D. column-reverse
Arranges items vertically in reverse order.
flex-direction: column-reverse;
4. Justify Content
The
justify-content property controls how flex items are distributed along the main axis..container {
display: flex;
justify-content: center;
}Important values:
• flex-start: Items at the beginning
• flex-end: Items at the end
• center: Items in the center
• space-between: Equal space between items
• space-around: Space around each item
• space-evenly: Equal spacing between and around items
.container {
display: flex;
justify-content: space-between;
}This distributes items with equal space between them.
5. Align Items
The
align-items property controls alignment along the cross axis..container {
display: flex;
align-items: center;
}•
stretch: Stretches items by default when possible.•
flex-start: Aligns items at the start.•
flex-end: Aligns items at the end.•
center: Aligns items in the center.•
baseline: Aligns items according to their text baselines.Remember:
•
justify-content = Main axis alignment.•
align-items = Cross axis alignment.The main axis depends on the
flex-direction.6. Flex Wrap
By default, flex items try to fit on one line.
The
flex-wrap property controls whether items can move onto another line..container {
display: flex;
flex-wrap: wrap;
}flex-wrap: nowrap;
flex-wrap: wrap;
flex-wrap: wrap-reverse;
This is useful when displaying product cards on different screen sizes.
7. Gap
The
You can also define row and column gaps separately:
8. Flex Grow
Box 2 receives twice as much of the available extra space as Box 1.
9. Flex Shrink
• 1 = Can shrink.
• 0 = Will not shrink due to the flex-shrink calculation.
10. Flex Basis
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:
The order is:
For example:
This is a common shorthand that allows an item to grow and shrink, with a zero-percent flex basis.
12. Align Self
Other values include:
• auto
• flex-start
• flex-end
• center
• baseline
• stretch
13. Real-World Example: Navigation Bar
HTML:
CSS:
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.
•
•
•
Double Tap ❤️ For Part-35
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! 🔥
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)
- 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:
Example:
This creates two equal-width columns.
2. Grid Container and Grid Items
CSS Grid has two important concepts.
Grid Container: The parent element with
Grid Items: The direct children inside the grid container.
3. grid-template-columns
The
This creates two columns, each 200px wide.
You can also use fractional units:
This creates three equal-width columns.
Another example:
The first column receives twice the available space of the second column.
4. grid-template-rows
The
This creates:
• First row: 100px high
• Second row: 200px high
5. The Gap Property
The
You can also control spacing separately:
6. grid-template-areas
Grid areas allow you to name different sections of a layout.
Visual structure:
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:
This makes the item occupy two columns.
Row spanning:
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
Instead of writing:
You can write:
Both create three equal-width columns.
9. minmax() Function
The
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.
•
•
These are especially useful for responsive card layouts.
11. Real-World Example: Product Grid
HTML:
CSS:
This creates a responsive product grid that adjusts the number of columns based on available space.
12. Flexbox vs CSS Grid
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
Key Takeaways
• CSS Grid creates two-dimensional layouts.
• Use
• Use
• Use
• Use
• Use
• Use
Double Tap ❤️ For More
• 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🔥
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.,
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
•
•
9. What is event bubbling in JavaScript
Events propagate from child to parent elements. Can be controlled using
10. What is the difference between localStorage and sessionStorage
•
•
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
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 closed11. 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