12. Why use <blockquote> in HTML?
Anonymous Quiz
0%
A) Highlight large text
100%
B) Display long quoted content from another source
0%
C) Add bold text
0%
D) Create tables
13. What happens if you forget to close a <p> tag?
Anonymous Quiz
38%
A) The browser ignores all following content
0%
B) It breaks the entire page
54%
C) The browser automatically closes it, but structure may be affected
8%
D) It creates a new line
14. What is the main purpose of <aside>?
Anonymous Quiz
0%
A) Add audio files
100%
B) Display unrelated side content, like advertisements or links
0%
C) Style buttons
0%
D) Add a footer
15. Which HTML element defines navigation links?
Anonymous Quiz
8%
A) <navigation>
85%
B) <nav>
8%
C) <menu>
0%
D) <links>
π¨ Week 2 Day 1: Introduction to CSS (Cascading Style Sheets)
π‘ Topic:
What is CSS? Why It Matters, How It Works.
π― Goal:
β‘οΈUnderstand the basics of CSS,
β‘οΈhow to apply styles to HTML,
β‘οΈ and try your first styles.
π Welcome Back to Fullstack Summer Camp!
You survived HTML week β now letβs make those plain web pages look awesome using CSS!
Imagine HTML as building a house: walls, rooms, and windows. CSS is painting, decorating, adding curtains, choosing colors, shapes, and sizes.
β
1οΈβ£ What is CSS?
CSS stands for Cascading Style Sheets.
Itβs a language that tells the browser how things should look on a web page. >
HTML = Structure >
CSS = Style / Design
Example:<p>This is a paragraph.</p>
Without CSS β Looks plain.
With CSS β You can change:
β€Color
β€Font
β€Size
β€Spacing
β€Borders
β€Background
β 2οΈβ£ How to Add CSS to HTML
There are 3 main ways:
a) Inline CSS (inside an HTML tag)
<p style="color: red;">Hello!</p> π Used for very small, one-time changes. Not recommended for full websites.
b) Internal CSS (inside <style> in the HTML file)
<!DOCTYPE html>
<html>
<head>
<style>
p {
color: blue;
font-size: 20px;
}
</style>
</head>
<body>
<p>This is blue text!</p>
</body>
</html> π Good for small projects. Easy for practice.
c) External CSS (linked as a separate file)
HTML file:
<link rel="stylesheet" href="style.css"> style.css file:
p {
color: green;
} π Best practice for real websites. Keeps things organized!
β 3οΈβ£ CSS Selectors: How CSS Targets HTML
Basic Rule Format:
selector {
property: value;
} Selector β Which element (like p, h1, or a class)
Property β What to change (like color, size)
Value β How you want it (red, 20px)
We can:
β€select by type/element:
P, h1, h3, img , span ....
p {
color: blue;}
β€select by class
We use " . "before the name of the class.
HtmlβΊ
<p class="highlight">Don't forget this</p>
cssβΊ
.highlight {
background-color:yellow;}
β€select by ID
We use "#" before ID name
HtmlβΊ
<button id="main">click</button>
cssβΊ
#main {
background-color: green;}
β€you can also target elements that are inside (nested)
βΊHtml
<div>
<h2>Menu Today</h2>
<p>We have coffee and tea.</p>
</div>
<h2>Thank You</h2>
βΊCss
div h2 {
color: orange;
}
β 4οΈβ£ Common Properties with Examples
1. Color
h1 {
color: purple; } 2. Background Color
body {
background-color: lightgray; } 3. Font Size
p {
font-size: 18px; } 4. Font Family
p {
font-family: Arial, sans-serif; } 5. Text Align
h2 {
text-align: center; } 6. Width and Height
7. Borderdiv {
width: 300px;
height: 150px;
background-color: yellow; }
p {
border: 2px solid black; } 8. Padding (space inside element) and Margin(space outside element)
div {
padding: 20px;
margin: 30px; } 9. border-radius:
Rounds corners
img {
border-radius: 10px; }
10. box-shadow:
Adds shadow around boxes
div {
box-shadow: 2px 2px 8px gray; }
11. opacity:
Makes things transparent
img {
opacity: 0.8; }
12. cursor:
Changes mouse cursor
button {
cursor: pointer; }
13. text-decoration: (underline)
a {
text-decoration: none; }
14. display:
Controls layout
div {15.position:
display : block; }
span {
display: inline; }
Controls exact placement
div {β 5οΈβ£ Combining Multiple Properties
position: absolute;
top: 10px;
left: 20px; }
β 6οΈβ£ Real Life Analogyp {
color: white;
background-color: black;
font-size: 20px;
text-align: justify; }
Think of CSS as designing your injera restaurant menu:
The structure is the menu paper (HTML)
The font color, layout, and sizes are CSS.
When someone looks at it, they notice the style first!
β 7β£ Summary
βοΈ CSS = Design and Style
βοΈ 3 Ways to add CSS (Inline, Internal, External)
βοΈ Use selectors + properties
βοΈ Common styles: color, background, font-size, width, border
#Week2 #Day1 #Css #introductionCss #lesson
Assignment:
Adding cssβ€
https://youtu.be/uzF1Doc3cZQ?si=wpeZYkJgrjEoiLMI
Fonts
β€https://youtu.be/MnyCbILmtOY?si=SJc39ucr29EYGwyr
Colors
β€https://youtu.be/LwbKb2J8iy8?si=dS_qmuBZF5Y7i596
Borders
β€https://youtu.be/pkNdQ7TmxIw?si=EyfEaWAV8fiqW_5d
Margin
β€https://youtu.be/rBWA_t-KnKk?si=0v65S6nUwXrmhF6V
Display
β€https://youtu.be/9T8uxp5hQ60?si=bXQ_P7Z55Yodre9Y
#Week2 #Day1 #Css #introductionCss #resources
Adding cssβ€
https://youtu.be/uzF1Doc3cZQ?si=wpeZYkJgrjEoiLMI
Fonts
β€https://youtu.be/MnyCbILmtOY?si=SJc39ucr29EYGwyr
Colors
β€https://youtu.be/LwbKb2J8iy8?si=dS_qmuBZF5Y7i596
Borders
β€https://youtu.be/pkNdQ7TmxIw?si=EyfEaWAV8fiqW_5d
Margin
β€https://youtu.be/rBWA_t-KnKk?si=0v65S6nUwXrmhF6V
Display
β€https://youtu.be/9T8uxp5hQ60?si=bXQ_P7Z55Yodre9Y
#Week2 #Day1 #Css #introductionCss #resources
YouTube
Get started with CSS in 8 minutes! π¨
#CSS #tutorial #course
CSS tutorial example explained inline internal external
00:00:00 introduction
00:00:26 inline
00:01:46 internal
00:03:05 external
00:04:27 id
00:05:26 class
00:06:29 linking more than 1 document
00:07:40 conclusion
CSS tutorial example explained inline internal external
00:00:00 introduction
00:00:26 inline
00:01:46 internal
00:03:05 external
00:04:27 id
00:05:26 class
00:06:29 linking more than 1 document
00:07:40 conclusion
πͺ Week 2 Day 1 Challenges: Css
Todayβs task isnβt about writing a new HTML page β
Instead, weβll go back to all the HTML files we already created (restaurant page, bookstore, scholarship form, cover page...) and add CSS styles using what we learned so far!
β What to do:
1οΈβ£ Open all your old HTML pages.
2οΈβ£ Apply as many CSS styles as possible:
βΊColors
βΊFont sizes
βΊBorders
βΊBackgrounds
βΊPadding and margins
βΊDiv layout and positioning
βΊMedia elements (images/videos) styling
3οΈβ£ Use external or internal CSS (not inline only!).
4οΈβ£ Make them clean, readable, and stylish.
β Reminder:
Use all methods we learned β even the selectors like:
div p {} or ul li {} or classes and IDs.
π₯ When You Finish:
β€ Share screenshots or code samples in the group.
β€ Invite your friends to join and learn with us.
β€ βοΈStay well and keep practicing!
#Week2 #Day1 #Css #introductionCss #challenge
Todayβs task isnβt about writing a new HTML page β
Instead, weβll go back to all the HTML files we already created (restaurant page, bookstore, scholarship form, cover page...) and add CSS styles using what we learned so far!
β What to do:
1οΈβ£ Open all your old HTML pages.
2οΈβ£ Apply as many CSS styles as possible:
βΊColors
βΊFont sizes
βΊBorders
βΊBackgrounds
βΊPadding and margins
βΊDiv layout and positioning
βΊMedia elements (images/videos) styling
3οΈβ£ Use external or internal CSS (not inline only!).
4οΈβ£ Make them clean, readable, and stylish.
β Reminder:
Use all methods we learned β even the selectors like:
div p {} or ul li {} or classes and IDs.
π₯ When You Finish:
β€ Share screenshots or code samples in the group.
β€ Invite your friends to join and learn with us.
β€ βοΈStay well and keep practicing!
#Week2 #Day1 #Css #introductionCss #challenge
π Week 2 Day 2: CSS Intermediate β Layout, Selectors, and Rules
π― Topics for Today:
1οΈβ£ Pseudo Classes and Elements
2οΈβ£ Sibling Combinators: ., >, +, ~
3οΈβ£ Box Model Deep Dive
4οΈβ£ Margin, Border, Padding β Full Control
5οΈβ£ CSS Conflicts: Cascading, Source, Specificity, Inheritance
β 1οΈβ£ Pseudo Classes and Elements
β€ What Are They?
They target specific states or parts of elements.
β¨ Pseudo Classes Examples:
β‘οΈ :hover
β When mouse is over.
βImagine a button in an app , when you hover your mouse over it , the color changes.
β‘οΈ :focus β When an input is active/selected.
β‘οΈ :first-child β First element inside parent.
β‘οΈ :nth-child(2) β Second child.
β¨ Pseudo Elements Examples:
βthey are used when you want to add decoration with out changing the html
β‘οΈ ::before
β‘οΈ ::after
β‘οΈ ::first-letter
β 2οΈβ£ Sibling Combinators in CSS
β€ Why Use Them?
To style elements based on their position relative to others. This helps you control exactly where and when styles apply.
βοΈ Examples:
β‘οΈ .class1 .class2 {} β Any .class2 inside .class1.
β‘οΈ > (Child Selector)
Only selects direct children, not grand children π
β‘οΈ + (Adjacent Sibling Selector)
Selects the very next <p> after <h1>.
β‘οΈ ~ (General Sibling Selector)
Selects all following siblings.
β 3οΈβ£ Box Model Deep Dive
All HTML elements have:
βContent = what's written/shown
β Padding = space inside box , around content
β Border = the edge of the box
β Margin = space outside the box , around other boxes
β€ Display Types
βοΈ display: block;
βοΈ display: inline;
βοΈ display: inline-block;
β Example:
β€ Box Sizing
βοΈ box-sizing: content-box; (default , width doesn't include padding or border)
βοΈ box-sizing: border-box; (includes padding + border)
β Example:
β 4οΈβ£ Margin, Border, Padding β Sides
You can control:
margin-top
margin-bottom
margin-left
margin-right
β Example:
Or shorthand:
β 5οΈβ£ CSS Conflicts: Cascading, Source, Specificity, Inheritance
When two styles target the same thing, which one wins?
β€ Cascading Order
Inline styles (strongest)
Internal CSS (in <style> tags)
External CSS (weakest)
β€ Specificity
More specific selectors override simpler ones.
3β£type selectors(p, img, div)==weak
2β£class selectors(.highleight, .topic)==stronger
1β£ID selectors (#main, #sec)==Strongest
β€ Source Order
The last rule in the CSS file usually wins if specificity is equal.
β€ Inheritance
Some properties like color, font-family, line-height inherit from parent.
But layout properties like margin, padding , border donβt.
β 6οΈβ£ Quick Summary Checklist
βοΈ Pseudo Classes = :hover, :first-child, :nth-child()
βοΈ Pseudo Elements = ::before, ::after
βοΈ Sibling Selectors = >, +, ~
βοΈ Box Model = Padding, Border, Margin
βοΈ CSS Conflicts = Understand specificity, cascade, inheritance
#Week2 #Day2 #Css #CssLayout #lesson
π― Topics for Today:
1οΈβ£ Pseudo Classes and Elements
2οΈβ£ Sibling Combinators: ., >, +, ~
3οΈβ£ Box Model Deep Dive
4οΈβ£ Margin, Border, Padding β Full Control
5οΈβ£ CSS Conflicts: Cascading, Source, Specificity, Inheritance
β 1οΈβ£ Pseudo Classes and Elements
β€ What Are They?
They target specific states or parts of elements.
β¨ Pseudo Classes Examples:
β‘οΈ :hover
β When mouse is over.
βImagine a button in an app , when you hover your mouse over it , the color changes.
button:hover {
background-color: yellow; } β‘οΈ :focus β When an input is active/selected.
input:focus {
border-color: blue; }
β‘οΈ :first-child β First element inside parent.
ul li:first-child {
color: red; } β‘οΈ :nth-child(2) β Second child.
p:nth-child(2) {
font-weight: bold; } β¨ Pseudo Elements Examples:
βthey are used when you want to add decoration with out changing the html
β‘οΈ ::before
p::before {
content: "π "; }
β‘οΈ ::after
p::after {
content: " β
"; } β‘οΈ ::first-letter
p::first-letter {
font-size: 30px; } β 2οΈβ£ Sibling Combinators in CSS
β€ Why Use Them?
To style elements based on their position relative to others. This helps you control exactly where and when styles apply.
βοΈ Examples:
β‘οΈ .class1 .class2 {} β Any .class2 inside .class1.
div p {
color: green; }
β‘οΈ > (Child Selector)
div > p {
color: blue; } Only selects direct children, not grand children π
β‘οΈ + (Adjacent Sibling Selector)
h1 + p {
color: orange; } Selects the very next <p> after <h1>.
β‘οΈ ~ (General Sibling Selector)
h1 ~ p {
color: purple; } Selects all following siblings.
β 3οΈβ£ Box Model Deep Dive
All HTML elements have:
βContent = what's written/shown
β Padding = space inside box , around content
β Border = the edge of the box
β Margin = space outside the box , around other boxes
β€ Display Types
βοΈ display: block;
βοΈ display: inline;
βοΈ display: inline-block;
β Example:
span {
display: block; } β€ Box Sizing
βοΈ box-sizing: content-box; (default , width doesn't include padding or border)
βοΈ box-sizing: border-box; (includes padding + border)
β Example:
ο»Ώdiv {
width: 200px;
padding: 20px;
box-sizing: border-box; }
β 4οΈβ£ Margin, Border, Padding β Sides
You can control:
margin-top
margin-bottom
margin-left
margin-right
β Example:
div {
margin-top: 20px;
margin-right: 10px;
border: 2px solid black;
padding: 15px; }
Or shorthand:
margin: 20px 10px 15px 5px; /* Top, Right, Bottom, Left */ β 5οΈβ£ CSS Conflicts: Cascading, Source, Specificity, Inheritance
When two styles target the same thing, which one wins?
β€ Cascading Order
Inline styles (strongest)
Internal CSS (in <style> tags)
External CSS (weakest)
β€ Specificity
More specific selectors override simpler ones.
3β£type selectors(p, img, div)==weak
2β£class selectors(.highleight, .topic)==stronger
1β£ID selectors (#main, #sec)==Strongest
β€ Source Order
The last rule in the CSS file usually wins if specificity is equal.
β€ Inheritance
Some properties like color, font-family, line-height inherit from parent.
But layout properties like margin, padding , border donβt.
β 6οΈβ£ Quick Summary Checklist
βοΈ Pseudo Classes = :hover, :first-child, :nth-child()
βοΈ Pseudo Elements = ::before, ::after
βοΈ Sibling Selectors = >, +, ~
βοΈ Box Model = Padding, Border, Margin
βοΈ CSS Conflicts = Understand specificity, cascade, inheritance
#Week2 #Day2 #Css #CssLayout #lesson
Assignment :
β€pseudo classes
https://youtu.be/Nrsy_2ogRfQ?si=dKtM_vb_cLt_JM8Q
β€pseudo elements
https://youtu.be/_LxYNxeWpBo?si=KlUEPdiRLDa0jpoY
β€nav-bar
https://youtu.be/f3uCSh6LIY0?si=44Yh4TVl8IB19ybn
#Week2 #Day2 #Css #CssLayout #resources
β€pseudo classes
https://youtu.be/Nrsy_2ogRfQ?si=dKtM_vb_cLt_JM8Q
β€pseudo elements
https://youtu.be/_LxYNxeWpBo?si=KlUEPdiRLDa0jpoY
β€nav-bar
https://youtu.be/f3uCSh6LIY0?si=44Yh4TVl8IB19ybn
#Week2 #Day2 #Css #CssLayout #resources
YouTube
Learn CSS pseudo-classes in 7 minutes! β
#css #course #tutorial
CSS pseudo classes hover link active tutorial example explained
CSS pseudo classes hover link active tutorial example explained
π¨Week 2 Day 2 Challenges:
π» Todayβs CSS Styling Challenge!
From all the HTML projects we did before β
β Cover Page
β Restaurant Website
β Bookstore Catalog
β Scholarship Application Form
π Now itβs time to make them look beautiful using todayβs CSS lessons!
π§ What to Include:
β¨ π― Style all lists and menus β Add background colors, borders, padding, spacing!
β¨ π― Use Flexbox to arrange sections β Menus, book items, form fields neatly side by side or centered.
β¨ π― Add borders, margins, and boxes β Around each important section (like menus, profile pictures, buttons).
β¨ π― Apply hover effects β Change button colors, link styles when someone moves their mouse over them.
β¨ π― Use pseudo-elements like ::before and ::after for decoration!
β¨ π― Try sibling combinators β Arrange things depending on position (like styling every <p> after <h1>).
β¨ π― Control the box model β Use margin, padding, width, and height smartly.
π π‘ Bonus Reminder: Use even the tags or methods we might have forgotten to mention before.
π Be creative β mix colors, shapes, and layouts!
πΈ β When Youβre Done:
β€ Share screenshots or the code in the group!
β€ Invite your friends to join Fullstack Summer Camp π»π₯
β€βοΈ Stay well, enjoy your styling, and see you tomorrow! β¨
#Week2 #Day2 #Css #CssLayout #challenge
π» Todayβs CSS Styling Challenge!
From all the HTML projects we did before β
β Cover Page
β Restaurant Website
β Bookstore Catalog
β Scholarship Application Form
π Now itβs time to make them look beautiful using todayβs CSS lessons!
π§ What to Include:
β¨ π― Style all lists and menus β Add background colors, borders, padding, spacing!
β¨ π― Use Flexbox to arrange sections β Menus, book items, form fields neatly side by side or centered.
β¨ π― Add borders, margins, and boxes β Around each important section (like menus, profile pictures, buttons).
β¨ π― Apply hover effects β Change button colors, link styles when someone moves their mouse over them.
β¨ π― Use pseudo-elements like ::before and ::after for decoration!
β¨ π― Try sibling combinators β Arrange things depending on position (like styling every <p> after <h1>).
β¨ π― Control the box model β Use margin, padding, width, and height smartly.
π π‘ Bonus Reminder: Use even the tags or methods we might have forgotten to mention before.
π Be creative β mix colors, shapes, and layouts!
πΈ β When Youβre Done:
β€ Share screenshots or the code in the group!
β€ Invite your friends to join Fullstack Summer Camp π»π₯
β€βοΈ Stay well, enjoy your styling, and see you tomorrow! β¨
#Week2 #Day2 #Css #CssLayout #challenge
π WEEK 2 DAY 3: CSS DEEP STYLING
π¨ Topic: Backgrounds, CSS Units, Replaced Elements
============================================
β 1οΈβ£ BACKGROUND PROPERTIES IN CSS
π Why background matters: It sets the mood and layout of your web page.
Think of it like painting your restaurant walls, putting posters up, or setting up banners.
------------------------------------------
πΈ 1.1 background-image:
Adds an image as a background.
Example:
πΈ 1.2 background-repeat:
Controls if and how the image repeats.
Options: repeat, no-repeat, repeat-x, repeat-y.
Example:
πΈ 1.3 background-size:
Controls image size in the background.
Options:
- auto
- cover (fills the whole area)
- contain (makes sure the full image shows)
Example:
πΈ 1.4 background-position:
Where the background starts from.
Example:
πΈ 1.5 background-attachment:
Controls scrolling behavior.
- scroll (default)
- fixed (image stays while content scrolls)
Example:
πΈ 1.6 background-gradient:
Uses two or more colors as background without images.
Examples:
=====================================
β 2οΈβ£ CSS UNITS + MEASUREMENTS
Units help make things the right size.
πΈ 2.1 px: Pixels
- Fixed unit. Small screens might look too big/small. It is not responsive.
Example:
πΈ 2.2 em: Relative to parent element
Example:
πΈ 2.3 rem: Relative to root element
- Keeps sizes consistent across page.
Example:
πΈ 2.4 % (Percentage)
Width or height relative to parent.
Example:
πΈ 2.5 vh & vw (Viewport height/width)
- 1vh = 1% of viewport height.
- 1vw = 1% of viewport width.
Example:
πΈ 2.6 min-width / max-width
Limits size changes.
Example:
πΈ 2.7 overflow
Controls content that goes outside the box.
Options:
- visible
- hidden
- scroll
- auto
Example:
πΈ 2.8 object-fit
Applies to <img>, <video>, etc.
Options: cover, contain, fill, none.
Example:
------------------------------------------
πΈ 2.9 COLORS (FUNCTIONS + SYSTEMS)
β rgb():
color: rgb(255, 0, 0);
β rgba(): (With transparency)
color: rgba(255, 0, 0, 0.5);
β hsl(): (Hue, Saturation, Lightness)
color: hsl(120, 100%, 50%);
β hsla():
color: hsla(120, 100%, 50%, 0.3);
β hwb(), lab(), lch():
Advanced color systems for modern browsers. Mostly for professional design systems.
===============================
β 3οΈβ£ REPLACED ELEMENTS: Styling
Replaced elements = Content controlled by the browser but styled by CSS.
Examples:
- <img>
- <video>
- <input>
- <iframe>
- <table>
πΈ 3.1 Styling Images
πΈ 3.2 Styling Videos
πΈ 3.3 Styling Forms (Inputs, Buttons)
π¨ Topic: Backgrounds, CSS Units, Replaced Elements
============================================
β 1οΈβ£ BACKGROUND PROPERTIES IN CSS
π Why background matters: It sets the mood and layout of your web page.
Think of it like painting your restaurant walls, putting posters up, or setting up banners.
------------------------------------------
πΈ 1.1 background-image:
Adds an image as a background.
Example:
body {
background-image: url("coffee.jpg");
}
πΈ 1.2 background-repeat:
Controls if and how the image repeats.
Options: repeat, no-repeat, repeat-x, repeat-y.
Example:
div {
background-image: url("pattern.png");
background-repeat: no-repeat;
}
πΈ 1.3 background-size:
Controls image size in the background.
Options:
- auto
- cover (fills the whole area)
- contain (makes sure the full image shows)
Example:
div {
background-image: url("sunset.jpg");
background-size: cover;
}
πΈ 1.4 background-position:
Where the background starts from.
Example:
div {
background-position: center center;
}
πΈ 1.5 background-attachment:
Controls scrolling behavior.
- scroll (default)
- fixed (image stays while content scrolls)
Example:
body {
background-image: url("forest.jpg");
background-attachment: fixed;
}
πΈ 1.6 background-gradient:
Uses two or more colors as background without images.
Examples:
div {
background: linear-gradient(to right, red, blue);
}
div {
background: radial-gradient(circle, yellow, green, blue);
}
=====================================
β 2οΈβ£ CSS UNITS + MEASUREMENTS
Units help make things the right size.
πΈ 2.1 px: Pixels
- Fixed unit. Small screens might look too big/small. It is not responsive.
Example:
p {
font-size: 16px;
}
πΈ 2.2 em: Relative to parent element
Example:
div {
font-size: 1.5em;
}
πΈ 2.3 rem: Relative to root element
- Keeps sizes consistent across page.
Example:
body {
font-size: 16px;
}
h1 {
font-size: 2rem;
}
πΈ 2.4 % (Percentage)
Width or height relative to parent.
Example:
div {
width: 50%;
}
πΈ 2.5 vh & vw (Viewport height/width)
- 1vh = 1% of viewport height.
- 1vw = 1% of viewport width.
Example:
section {
height: 100vh;
width: 100vw;
}
πΈ 2.6 min-width / max-width
Limits size changes.
Example:
img {
max-width: 100%;
min-width: 200px;
}
πΈ 2.7 overflow
Controls content that goes outside the box.
Options:
- visible
- hidden
- scroll
- auto
Example:
div {
width: 200px;
height: 200px;
overflow: scroll;
}
πΈ 2.8 object-fit
Applies to <img>, <video>, etc.
Options: cover, contain, fill, none.
Example:
img {
width: 100%;
height: 300px;
object-fit: cover;
}
------------------------------------------
πΈ 2.9 COLORS (FUNCTIONS + SYSTEMS)
β rgb():
color: rgb(255, 0, 0);
β rgba(): (With transparency)
color: rgba(255, 0, 0, 0.5);
β hsl(): (Hue, Saturation, Lightness)
color: hsl(120, 100%, 50%);
β hsla():
color: hsla(120, 100%, 50%, 0.3);
β hwb(), lab(), lch():
Advanced color systems for modern browsers. Mostly for professional design systems.
===============================
β 3οΈβ£ REPLACED ELEMENTS: Styling
Replaced elements = Content controlled by the browser but styled by CSS.
Examples:
- <img>
- <video>
- <input>
- <iframe>
- <table>
πΈ 3.1 Styling Images
img {
width: 100%;
max-width: 400px;
border: 2px solid black;
border-radius: 15px;
object-fit: cover;
}
πΈ 3.2 Styling Videos
video {
max-width: 600px;
border: 4px solid red;
border-radius: 10px;
}
πΈ 3.3 Styling Forms (Inputs, Buttons)
input, select, textarea {
padding: 12px;
margin: 10px 0;
border: 1px solid #ccc;
width: 100%;
}
button {
background: linear-gradient(to right, green, blue);
padding: 15px 30px;
color: white;
border: none;
border-radius: 8px;
}
button:hover {
background: linear-gradient(to right, blue, purple);
}
πΈ 3.4 Styling Tables
===============================
β EXTRA TIPS:
- Combine background properties into one shorthand:
background: url("bg.jpg") no-repeat center/cover fixed;
- Mix units smartly:
- rem for font sizes
- px for borders
- vh/vw for layout
β QUICK SUMMARY:
βοΈ Background images, gradients, sizes, positions.
βοΈ CSS units like px, em, rem, %, vh, vw.
βοΈ Overflow and object-fit.
βοΈ Advanced color functions (rgb, rgba, hsl, hsla).
βοΈ Styling images, forms, media, tables (Replaced Elements).
table {
width: 100%;
border-collapse: collapse;
}
th, td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #ddd;
}
tr:nth-child(even) {
background-color: #f9f9f9;
}
===============================
β EXTRA TIPS:
- Combine background properties into one shorthand:
background: url("bg.jpg") no-repeat center/cover fixed;
- Mix units smartly:
- rem for font sizes
- px for borders
- vh/vw for layout
β QUICK SUMMARY:
βοΈ Background images, gradients, sizes, positions.
βοΈ CSS units like px, em, rem, %, vh, vw.
βοΈ Overflow and object-fit.
βοΈ Advanced color functions (rgb, rgba, hsl, hsla).
βοΈ Styling images, forms, media, tables (Replaced Elements).
Assignment :
β€background-image
https://youtu.be/_oFWg_NlKdo?si=KwFKAy_8T0FaNona
β€overflow
https://youtu.be/d7cH8geV2dY?si=SMddhWXTINpRH0b3
β€position
https://youtu.be/G4AWXOr4W-k?si=feeSgnv8xS8r1uZD
β€background-image
https://youtu.be/_oFWg_NlKdo?si=KwFKAy_8T0FaNona
β€overflow
https://youtu.be/d7cH8geV2dY?si=SMddhWXTINpRH0b3
β€position
https://youtu.be/G4AWXOr4W-k?si=feeSgnv8xS8r1uZD
YouTube
How to include a CSS background image ποΈ
#CSS #tutorial #course
CSS background image tutorial example explained
body{
background-image: url(background.jpg);
background-repeat: no-repeat;
background-position: center;
background-attachment: fixed;
background-size: cover;
}
CSS background image tutorial example explained
body{
background-image: url(background.jpg);
background-repeat: no-repeat;
background-position: center;
background-attachment: fixed;
background-size: cover;
}
π₯Week 2 Day 3 Challenges:
π» TODAY'S CHALLENGE: BUILD YOUR OWN COURSE WEBSITE HOMEPAGE! π»π₯
π Hello Fullstack Summer Camp friends!
Todayβs challenge is a fun and practical one β weβre moving beyond random layouts and actually trying to imitate a real website layout.
Our inspiration? π [https://www.muyalogy.com](https://www.muyalogy.com)
βββββββββββββββββββ
π― YOUR MISSION:
β Build a homepage for an online learning website using ONLY HTML + CSS (NO JavaScript yet).
β The homepage should include:
1οΈβ£ Website title/logo at the top (you can write just the name as text)
2οΈβ£ A navigation bar with items like:
- Home
- Courses
- About
- Contact
3οΈβ£ 2β3 Courses Section:
β€ Each course should have:
- Course title
- Short description
- Image
- Price or rating
4οΈβ£ Footer section:
β€ Include things like copyright,
β€ Terms and conditions,
β€ Social media icons or text links (as placeholders).
β Use as many CSS styles as possible from everything weβve learned so far:
- Background images or gradients
- Pseudo-classes (like hover effects on buttons or links)
- Tables (if you wish for price comparison or schedule)
- Flex or Grid layout for neat alignment
- Colors, margins, paddings, fonts, etc.
βββββββββββββββββββ
π Extra Notes:
π You don't need to copy everything from the real site. Just the general layout and feel.
π You can get creative with colors and images that fit the education theme!
βββββββββββββββββββ
πΈ When Youβre Done:
β€ Share your finished homepage in the group! Screenshots or code files β both are welcome.
β€ Invite your friends who want to learn with us.
β€ Stay consistent, stay practicing, and as always...
βοΈStay well and happy coding!
π» TODAY'S CHALLENGE: BUILD YOUR OWN COURSE WEBSITE HOMEPAGE! π»π₯
π Hello Fullstack Summer Camp friends!
Todayβs challenge is a fun and practical one β weβre moving beyond random layouts and actually trying to imitate a real website layout.
Our inspiration? π [https://www.muyalogy.com](https://www.muyalogy.com)
βββββββββββββββββββ
π― YOUR MISSION:
β Build a homepage for an online learning website using ONLY HTML + CSS (NO JavaScript yet).
β The homepage should include:
1οΈβ£ Website title/logo at the top (you can write just the name as text)
2οΈβ£ A navigation bar with items like:
- Home
- Courses
- About
- Contact
3οΈβ£ 2β3 Courses Section:
β€ Each course should have:
- Course title
- Short description
- Image
- Price or rating
4οΈβ£ Footer section:
β€ Include things like copyright,
β€ Terms and conditions,
β€ Social media icons or text links (as placeholders).
β Use as many CSS styles as possible from everything weβve learned so far:
- Background images or gradients
- Pseudo-classes (like hover effects on buttons or links)
- Tables (if you wish for price comparison or schedule)
- Flex or Grid layout for neat alignment
- Colors, margins, paddings, fonts, etc.
βββββββββββββββββββ
π Extra Notes:
π You don't need to copy everything from the real site. Just the general layout and feel.
π You can get creative with colors and images that fit the education theme!
βββββββββββββββββββ
πΈ When Youβre Done:
β€ Share your finished homepage in the group! Screenshots or code files β both are welcome.
β€ Invite your friends who want to learn with us.
β€ Stay consistent, stay practicing, and as always...
βοΈStay well and happy coding!
Muyalogy
An innovative full-service learning platform that offers a comprehensive suite of online courses in a number of different areas.
πWEEK 2 DAY 4: CSS FLEXBOX &*Grid layouts
ππ Fullstack Campers! Let's dive in to flexboxes and Grid layouts today.
1β£ CSS Flexbox β The Ultimate Beginner-to-Intermediate Guide
π§± 1. Setting Up Flexbox
To use Flexbox, apply display: flex; to a container. This makes its direct children flexible items.
Css:
β 2. Flex Container Properties
These properties are applied to the parent element.
πΈ flex-direction
Controls the main axis direction.
π¦ Example
This stacks items vertically.
πΈ justify-content
Aligns items along the main axis (left to right by default).
π¦ Example:
πΈ align-items
Aligns items vertically (along the cross-axis).
π¦ Example:
πΈ flex-wrap
By default, items will try to fit in one line. Use wrap to move overflowing items to a new line
β€
πΈ align-content
Used only when there are multiple lines (i.e. when flex-wrap: wrap; is applied). It aligns the rows of items.
β€
π§ 3. Flex Item Properties
These are applied to individual child elements inside a flex container.
πΉ flex-grow
Defines how much a flex item can grow relative to others.
π¦ Example:
Item 2 will be twice as wide as Item 1.
πΉ flex-shrink
Defines how much an item can shrink if space is tight.
πΉ flex-basis
Defines the initial size before space is distributed.
πΉ flex
A shorthand for:
π¦ Example:
πΉ align-self
Overrides align-items for a single item.
π§ͺ 4. Complete Example
π 5. Flexbox Tricks You Should Know
πΉ Equal height columns
πΉ Center anything (vertical + horizontal)
πΉ Responsive layout (great on mobile! Coming soon)
πΉ Reordering items with order
πΉ Avoids using floats or positioning
ππ Fullstack Campers! Let's dive in to flexboxes and Grid layouts today.
1β£ CSS Flexbox β The Ultimate Beginner-to-Intermediate Guide
Flexbox (Flexible Box Layout) is used to arrange items in a row or column and control their alignment, spacing, and distributionβeven when their sizes are unknown or dynamic.
π§± 1. Setting Up Flexbox
To use Flexbox, apply display: flex; to a container. This makes its direct children flexible items.
<div class="container">
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
</div>
Css:
.container {
display: flex;
} β 2. Flex Container Properties
These properties are applied to the parent element.
πΈ flex-direction
Controls the main axis direction.
.container {
display: flex;
flex-direction: row;
flex-direction: column;
flex-direction: row-reverse;
flex-direction: column-reverse; } π¦ Example
.container {
display: flex;
flex-direction: column; } This stacks items vertically.
πΈ justify-content
Aligns items along the main axis (left to right by default).
.container {
justify-content: flex-start;
justify-content: flex-end;
justify-content: center;
justify-content: space-between;
justify-content: space-around;
justify-content: space-evenly; } π¦ Example:
.container {
display: flex;
justify-content: space-between; } πΈ align-items
Aligns items vertically (along the cross-axis).
.container {
align-items: stretch;
align-items: flex-start;
align-items: flex-end;
align-items: center;
align-items: baseline; } π¦ Example:
.container {
display: flex;
align-items: center; } πΈ flex-wrap
By default, items will try to fit in one line. Use wrap to move overflowing items to a new line
β€
nowrap/* default */
β€ wrap
β€ wrap-reverseπΈ align-content
Used only when there are multiple lines (i.e. when flex-wrap: wrap; is applied). It aligns the rows of items.
β€
stretch;
β€ flex-start
β€ flex-end
β€center
β€ space-between
β€ space-aroundπ§ 3. Flex Item Properties
These are applied to individual child elements inside a flex container.
πΉ flex-grow
Defines how much a flex item can grow relative to others.
.item { flex-grow: 1; /* Will grow equally with others */ } π¦ Example:
.item1 { flex-grow: 1; }
.item2 { flex-grow: 2; } Item 2 will be twice as wide as Item 1.
πΉ flex-shrink
Defines how much an item can shrink if space is tight.
.item { flex-shrink: 0; /* Won't shrink */ } πΉ flex-basis
Defines the initial size before space is distributed.
.item { flex-basis: 200px; } πΉ flex
A shorthand for:
flex: grow shrink basis; π¦ Example:
.item { flex: 1 1 200px; } πΉ align-self
Overrides align-items for a single item.
.item { align-self: center; } π§ͺ 4. Complete Example
<style> .container {
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
height: 200px;
background-color: #f2f2f2; }
.item {
background: orange;
padding: 20px;
color: white;
margin: 10px;
flex: 1; } </style>
<div class="container">
<div class="item">π Item 1</div>
<div class="item">π Item 2</div>
<div class="item">π Item 3</div>
</div> π 5. Flexbox Tricks You Should Know
πΉ Equal height columns
πΉ Center anything (vertical + horizontal)
πΉ Responsive layout (great on mobile! Coming soon)
πΉ Reordering items with order
πΉ Avoids using floats or positioning
2β£ CSS Grid Layout
β What is CSS Grid?
CSS Grid is a two-dimensional layout system that allows you to control both rows and columns at the same time. Unlike Flexbox (which is one-dimensional), Grid gives you full control over the layout of your elements.
Itβs especially useful for building complex web layouts without hacks like floats or flex-wrap tricks.
πΈ 1. Creating a Grid Container
You start by declaring display: grid on the parent element.
Example:
πΉ 2. Defining Columns and Rows
Use grid-template-columns and grid-template-rows.
π Fixed sizes:
π Responsive using fr unit (fractional):
π Repeat:
πΈ 3. Gap Between Items
Use gap, row-gap, or column-gap.
πΈ 4. Placing Items in Grid
Grid items can span columns or rows using:
You can also use span:
πΉ 5. Named Areas
Use grid-template-areas for visually mapping the layout.
Then assign elements:
πΉ 6. Aligning Items
βjustify-items: Align items horizontally (inside each grid cell).
βalign-items: Align items vertically (inside each grid cell).
βjustify-content: Align the entire grid horizontally.
βalign-content: Align the entire grid vertically.
π§ 7. Auto-placement
Let grid place items automatically based on available space.
βοΈ This is super useful for responsive grids (like image galleries or cards).
π§ͺ 8. Complete Example β Simple Blog Layout
β What is CSS Grid?
CSS Grid is a two-dimensional layout system that allows you to control both rows and columns at the same time. Unlike Flexbox (which is one-dimensional), Grid gives you full control over the layout of your elements.
Itβs especially useful for building complex web layouts without hacks like floats or flex-wrap tricks.
πΈ 1. Creating a Grid Container
You start by declaring display: grid on the parent element.
.container { display: grid; } Example:
<div class="container">
<div>1οΈβ£</div>
<div>2οΈβ£</div>
<div>3οΈβ£</div>
</div> .container {display: grid;
grid-template-columns: 100px 100px 100px; }
πΉ 2. Defining Columns and Rows
Use grid-template-columns and grid-template-rows.
π Fixed sizes:
.container {
display: grid;
grid-template-columns: 200px 150px;
grid-template-rows: 100px 100px; } π Responsive using fr unit (fractional):
.container {
display: grid;
grid-template-columns: 1fr 2fr; } π Repeat:
.container {
display: grid;
grid-template-columns: repeat(3, 1fr); } πΈ 3. Gap Between Items
Use gap, row-gap, or column-gap.
.container { gap: 20px; } πΈ 4. Placing Items in Grid
Grid items can span columns or rows using:
.item {
grid-column: 1 / 3; /* start at 1, end before 3 */
grid-row: 2 / 4; } You can also use span:
.item { grid-column: span 2; } πΉ 5. Named Areas
Use grid-template-areas for visually mapping the layout.
.container {
display: grid;
grid-template-columns: 1fr 2fr;
grid-template-rows: auto auto;
grid-template-areas: "header header" "sidebar content"; } Then assign elements:
.header { grid-area: header; }
.sidebar { grid-area: sidebar; }
.content { grid-area: content; } πΉ 6. Aligning Items
βjustify-items: Align items horizontally (inside each grid cell).
βalign-items: Align items vertically (inside each grid cell).
βjustify-content: Align the entire grid horizontally.
βalign-content: Align the entire grid vertically.
.container {
justify-items: center;
align-items: center; } π§ 7. Auto-placement
Let grid place items automatically based on available space.
.container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } βοΈ This is super useful for responsive grids (like image galleries or cards).
π§ͺ 8. Complete Example β Simple Blog Layout
<style>
.container {
display: grid;
grid-template-areas: "header header" "sidebar main" "footer footer";
grid-template-columns: 1fr 3fr;
grid-template-rows: auto 1fr auto;
gap: 20px;
min-height: 100vh; }
.header {
grid-area: header;
background: #1e90ff;
color: white;
padding: 1rem; }
.sidebar {
grid-area: sidebar;
background: #f0f0f0;
padding: 1rem; }
.main {
grid-area: main;
background: #fff;
padding: 1rem; }
.footer {
grid-area: footer;
background: #1e90ff;
color: white;
padding: 1rem;
text-align: center; }
</style>
<div class="container">
<div class="header">π My Blog</div>
<div class="sidebar">π Categories</div>
<div class="main">π Blog Content goes here</div>
<div class="footer">Β© 2025 My Blog</div>
</div>Assignment
β€flexbox
https://youtu.be/GteJWhCikCk?si=yaFF8FOp9nDlgGyn
β€Grid layout
https://youtu.be/eHaZlFcGl6k?si=BEFCy3JDqiMm14yZ
β€flexbox
https://youtu.be/GteJWhCikCk?si=yaFF8FOp9nDlgGyn
β€Grid layout
https://youtu.be/eHaZlFcGl6k?si=BEFCy3JDqiMm14yZ
YouTube
Learn CSS flexbox in 10 minutes! πͺ
#CSS #course #tutorial
CSS flexbox introduction tutorial example explained
00:00:00 intro
00:00:12 HTML setup
00:00:52 CSS setup
00:01:58 display: flex
00:02:18 flex-direction
00:02:58 justify-content
00:04:13 CSS setup
00:04:48 align-items
00:05:48 flexβ¦
CSS flexbox introduction tutorial example explained
00:00:00 intro
00:00:12 HTML setup
00:00:52 CSS setup
00:01:58 display: flex
00:02:18 flex-direction
00:02:58 justify-content
00:04:13 CSS setup
00:04:48 align-items
00:05:48 flexβ¦